mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
schemas are also loaded in all subfolders
This commit is contained in:
parent
3d07421dd9
commit
42fa4c9871
1 changed files with 15 additions and 12 deletions
|
|
@ -389,19 +389,22 @@ def gui_schema(subfolder, main_schema_name):
|
||||||
)
|
)
|
||||||
|
|
||||||
loaded_schemas = {}
|
loaded_schemas = {}
|
||||||
for filename in os.listdir(dirpath):
|
for root, _, filenames in os.walk(dirpath):
|
||||||
basename, ext = os.path.splitext(filename)
|
for filename in filenames:
|
||||||
if ext != ".json":
|
basename, ext = os.path.splitext(filename)
|
||||||
continue
|
if ext != ".json":
|
||||||
|
continue
|
||||||
|
|
||||||
filepath = os.path.join(dirpath, filename)
|
filepath = os.path.join(root, filename)
|
||||||
with open(filepath, "r") as json_stream:
|
with open(filepath, "r") as json_stream:
|
||||||
try:
|
try:
|
||||||
schema_data = json.load(json_stream)
|
schema_data = json.load(json_stream)
|
||||||
except Exception as e:
|
except Exception as exc:
|
||||||
raise Exception((f"Unable to parse JSON file {json_stream}\n "
|
raise Exception((
|
||||||
f" - {e}")) from e
|
f"Unable to parse JSON file {filepath}\n{exc}"
|
||||||
loaded_schemas[basename] = schema_data
|
)) from exc
|
||||||
|
|
||||||
|
loaded_schemas[basename] = schema_data
|
||||||
|
|
||||||
main_schema = _fill_inner_schemas(
|
main_schema = _fill_inner_schemas(
|
||||||
loaded_schemas[main_schema_name],
|
loaded_schemas[main_schema_name],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue