Skip to content

Commit

Permalink
Update aksetup to preserve commas in StringListOption defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Aug 1, 2012
1 parent 5ab5060 commit 7f7fa90
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aksetup_helper.py
Expand Up @@ -486,7 +486,7 @@ def value_to_str(self, default):
if default is None:
return None

return ",".join([str(el) for el in default])
return ",".join([str(el).replace(",", r"\,") for el in default])

def get_help(self, default):
return Option.get_help(self, default) + " (several ok)"
Expand All @@ -497,7 +497,11 @@ def take_from_configparser(self, options):
return None
else:
if opt:
return opt.split(",")
import re
sep = re.compile(r"(?<!\\),")
result = sep.split(opt)
result = [i.replace(r"\,", ",") for i in result]
return result
else:
return []

Expand Down

0 comments on commit 7f7fa90

Please sign in to comment.