mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
implemented get_template and get_schema
This commit is contained in:
parent
d0b32e1292
commit
770e33d0f9
1 changed files with 36 additions and 2 deletions
|
|
@ -307,10 +307,44 @@ class SchemasHub:
|
|||
return self._gui_types
|
||||
|
||||
def get_schema(self, schema_name):
|
||||
pass
|
||||
if schema_name not in self._loaded_schemas:
|
||||
if schema_name in self._loaded_templates:
|
||||
raise KeyError((
|
||||
"Template \"{}\" is used as `schema`"
|
||||
).format(schema_name))
|
||||
|
||||
elif schema_name in self._crashed_on_load:
|
||||
crashed_item = self._crashed_on_load[schema_name]
|
||||
raise KeyError(
|
||||
"Unable to parse schema file \"{}\". {}".format(
|
||||
crashed_item["filpath"], crashed_item["message"]
|
||||
)
|
||||
)
|
||||
|
||||
raise KeyError(
|
||||
"Schema \"{}\" was not found".format(schema_name)
|
||||
)
|
||||
return copy.deepcopy(self._loaded_schemas[schema_name])
|
||||
|
||||
def get_template(self, template_name):
|
||||
pass
|
||||
if template_name not in self._loaded_templates:
|
||||
if template_name in self._loaded_schemas:
|
||||
raise KeyError((
|
||||
"Schema \"{}\" is used as `template`"
|
||||
).format(template_name))
|
||||
|
||||
elif template_name in self._crashed_on_load:
|
||||
crashed_item = self._crashed_on_load[template_name]
|
||||
raise KeyError(
|
||||
"Unable to parse templace file \"{}\". {}".format(
|
||||
crashed_item["filpath"], crashed_item["message"]
|
||||
)
|
||||
)
|
||||
|
||||
raise KeyError(
|
||||
"Template \"{}\" was not found".format(template_name)
|
||||
)
|
||||
return copy.deepcopy(self._loaded_templates[template_name])
|
||||
|
||||
def resolve_schema_data(self, schema_data):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue