Terarea  2
The automation project
Loading...
Searching...
No Matches
src.lib.actions.trigger_management.TriggerManagement Class Reference
Collaboration diagram for src.lib.actions.trigger_management.TriggerManagement:
Collaboration graph

Public Member Functions

 __init__ (self, Variables variable, ActionLogger logger, RuntimeData runtime_data, Any scope="default_scope", int action_id=0, int error=84, int success=0, bool debug=False, int delay=10)
 
Any get_verification_operator (self, str operator)
 
Any get_response_verification (self, Dict[str, Any] response_node)
 
Any get_verification_value (self, Dict[str, Any] response_node)
 
Any get_response_content (self, str variable_name)
 
Any get_variable_data_if_required (self, str node, bool attempt_bruteforce=True)
 
bool check_data_comparison (self, Any data, ACONST.operator operator, Any verification_value)
 
None set_runtime_variables (self, Dict[str, Any] data)
 
int run (self, str key)
 

Data Fields

int error = error
 
Any scope = scope
 
int delay = delay
 
bool debug = debug
 
int success = success
 
str action_id = str(action_id)
 
ActionLogger logger = logger
 
Variables variable = variable
 
RuntimeData runtime_data = runtime_data
 
Disp disp
 
Secrets secrets
 
QueryEndpoint query_endpoint
 
APIQuerier api_querier_initialised = None
 
Dict[str, Any] api_response = None
 
tuple api_response = (node.get("response") or node.get("ignore:response"))
 

Protected Member Functions

int _log_fatal (self, str title, msg, int action_id, bool raise_item=False, object raise_func=ValueError)
 

Detailed Description

_summary_

Definition at line 23 of file trigger_management.py.

Constructor & Destructor Documentation

◆ __init__()

src.lib.actions.trigger_management.TriggerManagement.__init__ ( self,
Variables variable,
ActionLogger logger,
RuntimeData runtime_data,
Any scope = "default_scope",
int action_id = 0,
int error = 84,
int success = 0,
bool debug = False,
int delay = 10 )
_summary_
    This is the class in charge of checking the triggers and storing variables if required.

Args:
    variable (Variables): _description_: The class variable in charge of tracking the variables for the runtime.
    logger (ActionLogger): _description_: The class logger in charge of logging the actions.
    runtime_data (RuntimeData): _description_: The class runtime data in charge of containing important connections.
    action_id (int): _description_: The action ID to log.
    scope (Any, optional): _description_: The scope of the trigger. Defaults to "default_scope".
    error (int, optional): _description_. Defaults to 84.: The error value
    success (int, optional): _description_. Defaults to 0.: The success value
    debug (bool, optional): _description_. Defaults to False.: Set to True if you wish to activate debug mode.

Definition at line 27 of file trigger_management.py.

Member Function Documentation

◆ _log_fatal()

int src.lib.actions.trigger_management.TriggerManagement._log_fatal ( self,
str title,
msg,
int action_id,
bool raise_item = False,
object raise_func = ValueError )
protected
_summary_
    A function that will log a provided fatal error.

Args:
    title (str): _description_: the title of the function
    msg (str): _description_: The message to log
    raise_item (bool, optional): _description_. Inform if the logger should raise or just return an error. Defaults to False.
    raise_func (object, optional): _description_. The function to raise if required. Defaults to ValueError.

Raises:
    ValueError: _description_: One of the possible errors to raise.

Returns:
    int: _description_: Will return self.error if raise_item is False

Definition at line 77 of file trigger_management.py.

◆ check_data_comparison()

bool src.lib.actions.trigger_management.TriggerManagement.check_data_comparison ( self,
Any data,
ACONST.operator operator,
Any verification_value )
_summary_
    Check the data comparison.

Args:
    data (Any): _description_
    operator (Any): _description_
    verification_value (Any): _description_

Returns:
    bool: _description_

Definition at line 386 of file trigger_management.py.

◆ get_response_content()

Any src.lib.actions.trigger_management.TriggerManagement.get_response_content ( self,
str variable_name )
_summary_
    Get the response content.

Args:
    variable_name (str): _description_

Returns:
    Any: _description_

Definition at line 251 of file trigger_management.py.

◆ get_response_verification()

Any src.lib.actions.trigger_management.TriggerManagement.get_response_verification ( self,
Dict[str, Any] response_node )
_summary_
    Get the response verification.

Args:
    response_node (Dict[str, Any]): _description_

Returns:
    Any: _description_

Definition at line 166 of file trigger_management.py.

◆ get_variable_data_if_required()

Any src.lib.actions.trigger_management.TriggerManagement.get_variable_data_if_required ( self,
str node,
bool attempt_bruteforce = True )
_summary_
    Get the variable data if required.

Args:
    node (Dict[str, Any]): _description_

Returns:
    Any: _description_

Definition at line 327 of file trigger_management.py.

◆ get_verification_operator()

Any src.lib.actions.trigger_management.TriggerManagement.get_verification_operator ( self,
str operator )
_summary_
    Get the verification operator.

Args:
    operator (str): _description_

Returns:
    Any: _description_

Definition at line 105 of file trigger_management.py.

◆ get_verification_value()

Any src.lib.actions.trigger_management.TriggerManagement.get_verification_value ( self,
Dict[str, Any] response_node )
_summary_
    Get the verification value.

Args:
    response_node (Dict[str, Any]): _description_

Returns:
    Any: _description_

Definition at line 204 of file trigger_management.py.

◆ run()

int src.lib.actions.trigger_management.TriggerManagement.run ( self,
str key )
_summary_
    Run the trigger checking.

Returns:
    int: _description_: Returns self.success if the program succeeded, self.error otherwise.

Definition at line 447 of file trigger_management.py.

◆ set_runtime_variables()

None src.lib.actions.trigger_management.TriggerManagement.set_runtime_variables ( self,
Dict[str, Any] data )
_summary_
    Set the runtime variables.

Args:
    data (Any): _description_

Definition at line 415 of file trigger_management.py.

Field Documentation

◆ action_id

src.lib.actions.trigger_management.TriggerManagement.action_id = str(action_id)

Definition at line 47 of file trigger_management.py.

◆ api_querier_initialised

APIQuerier src.lib.actions.trigger_management.TriggerManagement.api_querier_initialised = None

Definition at line 74 of file trigger_management.py.

◆ api_response [1/2]

Dict[str, Any] src.lib.actions.trigger_management.TriggerManagement.api_response = None

Definition at line 75 of file trigger_management.py.

◆ api_response [2/2]

tuple src.lib.actions.trigger_management.TriggerManagement.api_response = (node.get("response") or node.get("ignore:response"))

Definition at line 538 of file trigger_management.py.

◆ debug

bool src.lib.actions.trigger_management.TriggerManagement.debug = debug

Definition at line 45 of file trigger_management.py.

◆ delay

int src.lib.actions.trigger_management.TriggerManagement.delay = delay

Definition at line 44 of file trigger_management.py.

◆ disp

Disp src.lib.actions.trigger_management.TriggerManagement.disp
Initial value:
= Disp(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
FILE_DESCRIPTOR,
debug=self.debug,
logger=self.__class__.__name__
)

Definition at line 52 of file trigger_management.py.

◆ error

int src.lib.actions.trigger_management.TriggerManagement.error = error

Definition at line 42 of file trigger_management.py.

◆ logger

ActionLogger src.lib.actions.trigger_management.TriggerManagement.logger = logger

Definition at line 48 of file trigger_management.py.

◆ query_endpoint

QueryEndpoint src.lib.actions.trigger_management.TriggerManagement.query_endpoint
Initial value:
= QueryEndpoint(
host="",
port=None,
delay=0,
debug=self.debug
)

Definition at line 67 of file trigger_management.py.

◆ runtime_data

RuntimeData src.lib.actions.trigger_management.TriggerManagement.runtime_data = runtime_data

Definition at line 50 of file trigger_management.py.

◆ scope

src.lib.actions.trigger_management.TriggerManagement.scope = scope

Definition at line 43 of file trigger_management.py.

◆ secrets

Secrets src.lib.actions.trigger_management.TriggerManagement.secrets
Initial value:
= Secrets(
success=self.success,
error=self.error,
debug=self.debug
)

Definition at line 61 of file trigger_management.py.

◆ success

int src.lib.actions.trigger_management.TriggerManagement.success = success

Definition at line 46 of file trigger_management.py.

◆ variable

Variables src.lib.actions.trigger_management.TriggerManagement.variable = variable

Definition at line 49 of file trigger_management.py.


The documentation for this class was generated from the following file: