Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/backend/PluginManager/ActionBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def get_is_multi_action(self) -> bool:
actions = self.page.action_objects.get(self.input_ident.input_type, {}).get(self.input_ident.json_identifier, [])
return len(actions) > 1

def get_asset_path(self, asset_name: str, subdirs: list[str] = [], asset_folder: str = "assets") -> str:
def get_asset_path(self, asset_name: str, subdirs: list[str] = None, asset_folder: str = "assets") -> str:
"""
Helper method that returns paths to plugin assets.

Expand All @@ -344,11 +344,13 @@ def get_asset_path(self, asset_name: str, subdirs: list[str] = [], asset_folder:
str: The full path to the asset
"""

if not subdirs:
return os.path.join(self.plugin_base.PATH, asset_folder, asset_name)

subdir = os.path.join(*subdirs)
if subdir != "":
return os.path.join(self.plugin_base.PATH, asset_folder, subdir, asset_name)
else:
return os.path.join(self.plugin_base.PATH, asset_folder, asset_name)
return ""

def has_label_control(self) -> list[bool]:
key_dict = self.input_ident.get_config(self.page).get("states", {}).get(str(self.state), {})
Expand Down