mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
validate tool identifier keys
This commit is contained in:
parent
50aaaec4da
commit
34b74ee7f9
1 changed files with 10 additions and 4 deletions
|
|
@ -71,10 +71,16 @@ class ExperimentalTools:
|
|||
if tool.is_available_for_host(host_name)
|
||||
]
|
||||
|
||||
self.tools_by_identifier = {
|
||||
tool.identifier: tool
|
||||
for tool in experimental_tools
|
||||
}
|
||||
# Store tools by identifier
|
||||
tools_by_identifier = {}
|
||||
for tool in experimental_tools:
|
||||
if tool.identifier in tools_by_identifier:
|
||||
raise KeyError((
|
||||
"Duplicated experimental tool identifier \"{}\""
|
||||
).format(tool.identifier))
|
||||
tools_by_identifier[tool.identifier] = tool
|
||||
|
||||
self.tools_by_identifier = tools_by_identifier
|
||||
self.tools = experimental_tools
|
||||
self._parent_widget = parent
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue