Accept either ObjectStates or ContainedObjects at top level of JSON
This commit is contained in:
parent
5392c2b1d6
commit
c1a8092ea2
@ -97,8 +97,12 @@ def unpackJson(json_file, output_name):
|
|||||||
with open(json_file) as f:
|
with open(json_file) as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|
||||||
|
if 'ObjectStates' in data:
|
||||||
|
prop = 'ObjectStates'
|
||||||
|
else:
|
||||||
|
prop = 'ContainedObjects'
|
||||||
recursivelyUnpackObject(
|
recursivelyUnpackObject(
|
||||||
'', data, subobject_prop='ObjectStates', base_name=output_name)
|
'', data, subobject_prop=prop, base_name=output_name)
|
||||||
|
|
||||||
|
|
||||||
def packYaml(yaml_file, output_json_file):
|
def packYaml(yaml_file, output_json_file):
|
||||||
|
Loading…
Reference in New Issue
Block a user