_action
TOC
- Attributes:
- Classes:
- 🅲 Action
- 🅲 ActionManager
Attributes
🅰 actionManager
actionManager = ActionManager()
Classes
🅲 Action
class Action(Callable):
🅼 __init__
def __init__(
self,
function: Callable,
name: str = None,
description: str = None,
blocking: bool = False,
**kwargs
):
🅼 get_props_dict
def get_props_dict(self):
🅼 __call__
def __call__(self, **argv):
🅼 eval_call
def eval_call(self, params: dict):
🅲 ActionManager
class ActionManager:
🅼 get_action_dict
def get_action_dict(self):
🅼 eval_call
def eval_call(
self, name: str, params: dict, callback: Optional[Callable] = None
):
🅼 _initialize
def _initialize(self):
🅼 register
def register(
self,
name: Optional[str] = None,
description: str = None,
blocking: bool = False,
):
register function as action visiable on frontend page
Parameters:
- name (Optional[str]) (default to
None(neetbox will use the function name when set to None)
): name of the action. Defaults to None(neetbox will use the function name when set to None). - description (str) (default to
None(neetbox will use function docs as default when set to None)
): description of the action. Defaults to None(neetbox will use function docs as default when set to None). - blocking (bool) (default to
False
): whether to run the action in a blocked query. Defaults to False.
Returns:
- Callable: the function itself.
🅼 _register
def _register(
self,
function: Callable,
name: str = None,
description: str = None,
blocking: bool = False,
):