Skip to content
Snippets Groups Projects
Commit 5129048c authored by Wouter Deconinck's avatar Wouter Deconinck Committed by MarkusFrankATcernch
Browse files

fix: split comma-separated string into list of dict

parent d4ac0711
No related branches found
No related tags found
No related merge requests found
...@@ -138,7 +138,7 @@ On the command line, these can be specified as JSON strings. ...@@ -138,7 +138,7 @@ On the command line, these can be specified as JSON strings.
try: try:
val = json.loads(val) val = json.loads(val)
except ValueError: except ValueError:
val = tuple(val.split(",")) val = [dict(name=v) for v in val.split(",")]
if isinstance(val, tuple): if isinstance(val, tuple):
# assumes: ( "Geant4TestEventAction", {"Property_int": 10} ) # assumes: ( "Geant4TestEventAction", {"Property_int": 10} )
# creates: { "name": "Geant4TestEventAction", "parameter": {"Property_int": 10} } # creates: { "name": "Geant4TestEventAction", "parameter": {"Property_int": 10} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment