From a5d51d6e5a752754b4d7fda70d19b3e3308a5917 Mon Sep 17 00:00:00 2001 From: Labrys of Knossos Date: Sat, 19 Jan 2019 11:45:38 -0500 Subject: [PATCH] Use generator exp for remote paths --- core/__init__.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/__init__.py b/core/__init__.py index a1e47591..b3d02541 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -491,10 +491,18 @@ def configure_remote_paths(): if REMOTE_PATHS: if isinstance(REMOTE_PATHS, list): REMOTE_PATHS = ','.join(REMOTE_PATHS) # fix in case this imported as list. - REMOTE_PATHS = [tuple(item.split(',')) for item in - REMOTE_PATHS.split('|')] # /volume1/Public/,E:\|/volume2/share/,\\NAS\ - REMOTE_PATHS = [(local.strip(), remote.strip()) for local, remote in - REMOTE_PATHS] # strip trailing and leading whitespaces + + REMOTE_PATHS = ( + # /volume1/Public/,E:\|/volume2/share/,\\NAS\ + tuple(item.split(',')) + for item in REMOTE_PATHS.split('|') + ) + + REMOTE_PATHS = [ + # strip trailing and leading whitespaces + (local.strip(), remote.strip()) + for local, remote in REMOTE_PATHS + ] def initialize(section=None):