From 7f7fa90c69781616ee448778e65336e368670452 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Wed, 1 Aug 2012 01:39:17 -0400 Subject: [PATCH] Update aksetup to preserve commas in StringListOption defaults. --- aksetup_helper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aksetup_helper.py b/aksetup_helper.py index cafdad64..12953df9 100644 --- a/aksetup_helper.py +++ b/aksetup_helper.py @@ -486,7 +486,7 @@ class StringListOption(Option): 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)" @@ -497,7 +497,11 @@ class StringListOption(Option): 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 [] -- GitLab