-
Notifications
You must be signed in to change notification settings - Fork 0
Module
class Module()Module class focused on communicate data with other modules.
def __init__(name: str = None, file: str = None, silent: bool = False) -> NoneClass constructor.
Arguments:
-
namestr, optional - desired name for the module. Defaults to None. -
filestr, optional - path to load JSON file and construct module following is content. Defaults to None. -
silentbool, optional - True -> will not print any error, False -> will print error. Defaults to False.
Raises:
-
IRONMultiInputError- raise an error when value and path are both at None or initilalized
def dumpJSON(file: str) -> NoneSave the module structure into a JSON file.
Arguments:
-
filestr - path to the JSON file
def addListener(name: str) -> NoneAdd a Shared Memory Server.
Arguments:
-
namestr - Shared Memory Name
def delListener(name: str) -> NoneRemove a Shared Memory Server.
Arguments:
-
name[type] - Shared Memory name
def addSender(name: str, value: any = None, path: str = None) -> NoneAdd a Shared Memory Client.
Arguments:
-
namestr - Shared Memory name -
value[type], optional - value to share with the other module. Defaults to None. -
pathstr, optional - path to load JSON file and share the data inside. Defaults to None.
def delSender(name: str) -> NoneRemove a Shared Memory Client.
Arguments:
-
namestr - Shared Memory name
def getLSName(listener: bool = True, sender: bool = True) -> listReturn a list that contains name of sender and listener.
Arguments:
-
listenerbool, optional - True -> will add listener names to the list. Defaults to True. -
senderbool, optional - True -> will ad sender names to the list. Defaults to True.
Returns:
[list, list]: list of sender and listener names
def getValue(name: str) -> anyGet value from a sender or a listener.
Arguments:
-
namestr - name of the sender or listener
Returns:
-
[type]- return data
def setValue(name: str, value: any) -> NoneUpdate data.
Arguments:
-
namestr - name of the sender or listener -
value[type] - new value to assign
def getLSAvailability(listener: bool = False, sender: bool = False) -> listGet the availability of each sender and listener.
Arguments:
-
listenerbool, optional - True -> will add listener availability. Defaults to None. -
senderbool, optional - True -> will add sender availability. Defaults to None.
Returns:
[list, list]: list of the sender and listener availability
def startModule(name: str = None) -> NoneStart senders and listeners.
Arguments:
-
namestr, optional - if setted will launch only this one. Defaults to None.
def stopModule(name: str = None) -> NoneStop senders and listeners.
Arguments:
-
namestr, optional - if setted will stop only this one. Defaults to None.
def startRemote(sender: bool, name: str = "") -> NoneStart remote communication.
Arguments:
-
senderbool - True -> will start remote sender, False -> will start remote listener -
namestr, optional - name of the listener. Defaults to "".
def stopRemote(sender: bool, name: str = "") -> NoneStop remote communication.
Arguments:
-
senderbool - True -> will stop remote sender, False -> will stop remote listener -
namestr, optional - name of the listener. Defaults to "".
def restartModule(name: str = None) -> NoneRestart senders and listeners.
Arguments:
-
namestr, optional - if setted will restart only this one. Defaults to None.