Base action function object. More...
Public Member Functions | |
def | __call__ |
def | __init__ |
def | __str__ |
def | add_callback |
def | optional |
Private Member Functions | |
def | _action_string |
def | _execute |
Private Attributes | |
_callbacks |
Base action function object.
Base class for all action function objects. Action objects should implement the _execute method. This will receive one argument (a reference to the RTCTree object) and should implement the action. It must return True for success or False for failure, and a very brief error message. All actions must be provided with one or more result callback objects. These will be called in the order they are set after performing the action and passed the result of the action's _execute method. Its job is to take appropriate measures based on the outcome of the action. Typically, the first should perform a verification that the result meets necessary criteria, such as a required action succeeding. If no callbacks are provided, a default (@ref BaseCallback) will be inserted. Action objects must implement the __str__ method. They should print out a description of what they will do. This description should include details specific to that instance of the action (for example, "Will activate component 'ConsoleIn0.rtc'").
Definition at line 33 of file actions.py.
def rtshell.actions.Action.__init__ | ( | self, | |
callbacks = [] |
|||
) |
Definition at line 56 of file actions.py.
def rtshell.actions.Action.__call__ | ( | self, | |
rtctree = None |
|||
) |
Definition at line 60 of file actions.py.
def rtshell.actions.Action.__str__ | ( | self | ) |
Reimplemented in rtshell.actions.StateChangeAct, rtshell.actions.DisconnectPortsAct, rtshell.actions.ConnectPortsAct, rtshell.actions.CheckForConnAct, rtshell.actions.SetConfigParamValueAct, rtshell.actions.CheckConfigParamAct, rtshell.actions.SetActiveConfigSetAct, rtshell.actions.CheckActiveConfigSetAct, rtshell.actions.CheckForPortAct, and rtshell.actions.CheckForRequiredCompAct.
Definition at line 69 of file actions.py.
def rtshell.actions.Action._action_string | ( | self, | |
action_desc | |||
) | [private] |
Definition at line 83 of file actions.py.
def rtshell.actions.Action._execute | ( | self, | |
rtctree | |||
) | [private] |
Base for action execution method. Return (True, '') or (False, 'Why I failed.') when implementing this method.
Reimplemented in rtshell.actions.StateChangeAct, rtshell.actions.DisconnectPortsAct, rtshell.actions.ConnectPortsAct, rtshell.actions.CheckForConnAct, rtshell.actions.SetConfigParamValueAct, rtshell.actions.CheckConfigParamAct, rtshell.actions.SetActiveConfigSetAct, rtshell.actions.CheckActiveConfigSetAct, rtshell.actions.CheckForPortAct, and rtshell.actions.CheckForRequiredCompAct.
Definition at line 91 of file actions.py.
def rtshell.actions.Action.add_callback | ( | self, | |
callback | |||
) |
Definition at line 72 of file actions.py.
def rtshell.actions.Action.optional | ( | self | ) |
Is this action optional?
Definition at line 76 of file actions.py.
rtshell::actions.Action::_callbacks [private] |
Definition at line 56 of file actions.py.