Skip to content

Commit

Permalink
Do not catch AttributeError on 'executor' method
Browse files Browse the repository at this point in the history
  • Loading branch information
CastagnaIT committed Dec 28, 2020
1 parent 9aa0c93 commit 6a66bd0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions resources/lib/run_addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ def _execute(executor_type, pathitems, params, root_handler):
"""Execute an action as specified by the path"""
try:
executor = executor_type(params).__getattribute__(pathitems[0] if pathitems else 'root')
LOG.debug('Invoking action: {}', executor.__name__)
executor(pathitems=pathitems)
if root_handler == G.MODE_DIRECTORY and not G.IS_ADDON_EXTERNAL_CALL:
# Save the method name of current loaded directory and his menu item id
WndHomeProps[WndHomeProps.CURRENT_DIRECTORY] = executor.__name__
WndHomeProps[WndHomeProps.CURRENT_DIRECTORY_MENU_ID] = pathitems[1] if len(pathitems) > 1 else ''
WndHomeProps[WndHomeProps.IS_CONTAINER_REFRESHED] = None
except AttributeError as exc:
raise InvalidPathError('Unknown action {}'.format('/'.join(pathitems))) from exc
LOG.debug('Invoking action: {}', executor.__name__)
executor(pathitems=pathitems)
if root_handler == G.MODE_DIRECTORY and not G.IS_ADDON_EXTERNAL_CALL:
# Save the method name of current loaded directory and his menu item id
WndHomeProps[WndHomeProps.CURRENT_DIRECTORY] = executor.__name__
WndHomeProps[WndHomeProps.CURRENT_DIRECTORY_MENU_ID] = pathitems[1] if len(pathitems) > 1 else ''
WndHomeProps[WndHomeProps.IS_CONTAINER_REFRESHED] = None


def _get_service_status():
Expand Down

0 comments on commit 6a66bd0

Please sign in to comment.