diff --git a/client/djrandom_client/utils.py b/client/djrandom_client/utils.py index a1241ee37f68e9e2260561c04c965bf362e9b31e..5efa285596b3b57dc273e73799eb71e1f20631f0 100644 --- a/client/djrandom_client/utils.py +++ b/client/djrandom_client/utils.py @@ -1,11 +1,8 @@ import hashlib -import logging import os NESTING = 2 -log = logging.getLogger(__name__) - def generate_path(base_dir, sha1): dir_parts = [base_dir] @@ -31,8 +28,14 @@ class SyntaxError(Exception): pass +def _unquote(s): + for qchar in ('"', '\''): + if s.startswith(qchar) and s.endswith(qchar): + return s.strip(qchar) + return s + + def read_config_defaults(parser, path): - log.debug('reading config from %s' % path) if not os.path.exists(path): return with open(path, 'r') as fd: @@ -44,5 +47,4 @@ def read_config_defaults(parser, path): raise SyntaxError('%s, line %d: Syntax Error' % ( path, 1 + linenum)) var, value = map(lambda x: x.strip(), line.split('=', 1)) - log.debug('config: %s = "%s"' % (var, value)) - parser.set_default(var, value) + parser.set_default(var, _unquote(value))