mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
warn about having string as output from plugin getter method
This commit is contained in:
parent
ba4412577b
commit
5e8dece22e
1 changed files with 13 additions and 9 deletions
|
|
@ -891,24 +891,28 @@ class AddonsManager:
|
||||||
if not isinstance(addon, IPluginPaths):
|
if not isinstance(addon, IPluginPaths):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
paths = None
|
||||||
method = getattr(addon, method_name)
|
method = getattr(addon, method_name)
|
||||||
try:
|
try:
|
||||||
paths = method(*args, **kwargs)
|
paths = method(*args, **kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
self.log.warning(
|
self.log.warning(
|
||||||
(
|
"Failed to get plugin paths from addon"
|
||||||
"Failed to get plugin paths from addon"
|
f" '{addon.name}' using '{method_name}'.",
|
||||||
" '{}' using '{}'."
|
|
||||||
).format(addon.__class__.__name__, method_name),
|
|
||||||
exc_info=True
|
exc_info=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not paths:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if paths:
|
if isinstance(paths, str):
|
||||||
# Convert to list if value is not list
|
paths = [paths]
|
||||||
if not isinstance(paths, (list, tuple, set)):
|
self.log.warning(
|
||||||
paths = [paths]
|
f"Addon '{addon.name}' returned invalid output type"
|
||||||
output.extend(paths)
|
f" from '{method_name}'."
|
||||||
|
f" Got 'str' expected 'list[str]'."
|
||||||
|
)
|
||||||
|
output.extend(paths)
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def collect_launcher_action_paths(self):
|
def collect_launcher_action_paths(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue