|
|
|
@ -1332,6 +1332,22 @@ def ActivityItemDefAliasCreate(inDef, inAliasStr=None, inGSettings = None):
|
|
|
|
|
inGSettings["ProcessorDict"]["AliasDefDict"][inAliasStr] = inDef
|
|
|
|
|
return inAliasStr
|
|
|
|
|
|
|
|
|
|
def ActivityItemDefAliasModulesLoad():
|
|
|
|
|
"""
|
|
|
|
|
Load all def from sys.modules... in ActivityItem def alias dict
|
|
|
|
|
|
|
|
|
|
:return: None
|
|
|
|
|
"""
|
|
|
|
|
lL = OrchestratorLoggerGet()
|
|
|
|
|
lL.info(f"ActivityItem aliases: start to load sys.modules")
|
|
|
|
|
for lModuleItemStr in sys.modules:
|
|
|
|
|
lModuleItem = sys.modules[lModuleItemStr]
|
|
|
|
|
for lDefItemStr in dir(lModuleItem):
|
|
|
|
|
lDefItem = getattr(lModuleItem,lDefItemStr)
|
|
|
|
|
if callable(lDefItem) and not lDefItemStr.startswith("_"):
|
|
|
|
|
ActivityItemDefAliasCreate(inDef=lDefItem, inAliasStr=f"{lModuleItemStr}.{lDefItemStr}")
|
|
|
|
|
lL.info(f"ActivityItem aliases: finish to load sys.modules")
|
|
|
|
|
|
|
|
|
|
def ActivityItemDefAliasUpdate(inDef, inAliasStr, inGSettings = None):
|
|
|
|
|
"""
|
|
|
|
|
Update alias for def (can be used in ActivityItem in field Def).
|
|
|
|
@ -2541,6 +2557,9 @@ def Orchestrator(inGSettings=None, inDumpRestoreBool = True, inRunAsAdministrato
|
|
|
|
|
lItemDef = getattr(lModule,lItemDefNameStr)
|
|
|
|
|
if callable(lItemDef): inGSettings["ProcessorDict"]["AliasDefDict"][lItemDefNameStr]=lItemDef
|
|
|
|
|
|
|
|
|
|
#Load all defs from sys.modules
|
|
|
|
|
ActivityItemDefAliasModulesLoad()
|
|
|
|
|
|
|
|
|
|
#Инициализация настроечных параметров
|
|
|
|
|
lDaemonLoopSeconds=gSettingsDict["SchedulerDict"]["CheckIntervalSecFloat"]
|
|
|
|
|
lDaemonActivityLogDict={} #Словарь отработанных активностей, ключ - кортеж (<activityType>, <datetime>, <processPath || processName>, <processArgs>)
|
|
|
|
|