mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
change tools mandatory attributes to set type and iterate only on those attributes
This commit is contained in:
parent
9c7bcb84aa
commit
f5d7634e00
1 changed files with 2 additions and 3 deletions
|
|
@ -75,13 +75,12 @@ No shelf definition found for shelf set named '{}'".format(shelf_set_name)
|
|||
shelf named {}".format(shelf_name))
|
||||
return
|
||||
|
||||
mandatory_attributes = ['name', 'script']
|
||||
mandatory_attributes = {'name', 'script'}
|
||||
for tool_definition in shelf_definition.get('tools_list'):
|
||||
# We verify that the name and script attibutes of the tool
|
||||
# are set
|
||||
if not all(
|
||||
[v for k, v in tool_definition.items() if
|
||||
k in mandatory_attributes]
|
||||
tool_definition[key] for key in mandatory_attributes
|
||||
):
|
||||
log.warning("TOOLS ERROR: You need to specify at least \
|
||||
the name and the script path of the tool.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue