Accept either ObjectStates or ContainedObjects at top level of JSON

This commit is contained in:
Adam Goldsmith 2022-10-19 23:10:35 -04:00
parent 5392c2b1d6
commit c1a8092ea2

View File

@ -97,8 +97,12 @@ def unpackJson(json_file, output_name):
with open(json_file) as f:
data = json.load(f)
if 'ObjectStates' in data:
prop = 'ObjectStates'
else:
prop = 'ContainedObjects'
recursivelyUnpackObject(
'', data, subobject_prop='ObjectStates', base_name=output_name)
'', data, subobject_prop=prop, base_name=output_name)
def packYaml(yaml_file, output_json_file):