gws.base.action.manager
¶
Source code: gws.base.action.manager
Module Contents¶
- gws.base.action.manager.get_action_for_cli(root: gws.Root, action_name: str, project_uid: str | None = None) gws.Action | None ¶
Get an action object by its name and optional project UID.
If no project UID is provided, it searches for the action in the global scope and then in all projects.
- class gws.base.action.manager.Object¶
Bases:
gws.ActionManager
Action manager.
- actions_for_project(project, user)¶
Get a list of actions for a project, to which a user has access to.
- Parameters:
project – The project requiring actions.
user – The user for whom the actions are retrieved.
- Returns:
A list of accessible actions.
- find_action(project, ext_type, user)¶
Locate an Action object.
- Parameters:
project – If provided, find the action for that project; otherwise, search globally.
ext_type – The extension type to search for.
user – Locate actions only for this user.
- Returns:
The located action object, or None if no match is found.
- prepare_action(command_category, command_name, params, user, read_options=None)¶
Prepare an action to be executed based on the provided parameters.
- Parameters:
command_category – The category of the command to execute.
command_name – The name of the command to execute.
params – Additional parameters required for the action.
user – The user initiating the action.
read_options – Read options for parsing parameters.
- Returns:
A tuple containing the callable to execute and the associated request object.
- gws.base.action.manager.parse_cli_request(root: gws.Root, command_category: gws.CommandCategory, command_name: str, params: dict, read_options=None)¶
Parse a CLI request and return the action handler and request object.