From c1a8092ea2f1ef7fd032d35388359d38d784a396 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 19 Oct 2022 23:10:35 -0400 Subject: [PATCH] Accept either ObjectStates or ContainedObjects at top level of JSON --- tts_yaml_unpacker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tts_yaml_unpacker.py b/tts_yaml_unpacker.py index 624bee7..03af549 100755 --- a/tts_yaml_unpacker.py +++ b/tts_yaml_unpacker.py @@ -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):