# HG changeset patch # User souliane # Date 1437558157 -7200 # Node ID ddc7a39ff9d10a214133daa5f786cf5c23e6dc2b # Parent 8ce9924fa92c5aff2bd2f0fa4f8cc942f2752a10 tools (config): when reading a list or dict from the config file, ignore spaces immediately following the delimiter diff -r 8ce9924fa92c -r ddc7a39ff9d1 src/tools/config.py --- a/src/tools/config.py Tue Jul 21 15:36:40 2015 +0200 +++ b/src/tools/config.py Wed Jul 22 11:42:37 2015 +0200 @@ -92,8 +92,8 @@ value = os.path.expanduser(value) # thx to Brian (http://stackoverflow.com/questions/186857/splitting-a-semicolon-separated-string-to-a-dictionary-in-python/186873#186873) elif name.endswith('_list'): - value = csv.reader([value], delimiter=',', quotechar='"').next() + value = csv.reader([value], delimiter=',', quotechar='"', skipinitialspace=True).next() elif name.endswith('_dict'): - value = dict(csv.reader([item], delimiter=':', quotechar='"').next() - for item in csv.reader([value], delimiter=',', quotechar='"').next()) + value = dict(csv.reader([item], delimiter=':', quotechar='"', skipinitialspace=True).next() + for item in csv.reader([value], delimiter=',', quotechar='"', skipinitialspace=True).next()) return value