tools (config): complexe data can now be set using json and the "_json" suffix
This commit is contained in:
parent
2a1777cf6f
commit
a01bec718e
1 changed files with 5 additions and 0 deletions
|
|
@ -111,4 +111,9 @@ def getConfig(config, section, name, default=None):
|
|||
raise exceptions.ParsingError(u"Error while parsing data: {}".format(e))
|
||||
if not isinstance(value, dict):
|
||||
raise exceptions.ParsingError(u"{name} value is not a dict: {value}".format(name=name, value=value))
|
||||
elif name.endswith('_json'):
|
||||
try:
|
||||
value = json.loads(value)
|
||||
except ValueError as e:
|
||||
raise exceptions.ParsingError(u"Error while parsing data: {}".format(e))
|
||||
return value
|
||||
|
|
|
|||
Loading…
Reference in a new issue