@ -30,7 +30,7 @@ class RepeatedTimer(object):
############################################################
####Техническая функция обработки таймера - потока
############################################################
def activityLoopExecution ( inProcessPath , inProcessArgList , inLoopTimeEndDateTime , inPythonPackageName , inPythonFunctionName ):
def activityLoopExecution ( inProcessPath , inProcessArgList , inLoopTimeEndDateTime , inPythonPackageName , inPythonFunctionName ,inPythonFunctionArgList = [ ] ):
lResultGoLoop = True
lCurrentDateTime = datetime . datetime . now ( )
print ( datetime . datetime . now ( ) . isoformat ( ) + " :: Loop activity check " )
@ -49,6 +49,7 @@ def activityLoopExecution(inProcessPath,inProcessArgList,inLoopTimeEndDateTime,i
lModule = importlib . import_module ( inPythonPackageName )
#Найти функцию
lFunction = getattr ( lModule , inPythonFunctionName )
lFunction ( * inPythonFunctionArgList )
except Exception as e :
print ( datetime . datetime . now ( ) . isoformat ( ) + " :: Loop activity error: module/function not founded " )
@ -60,6 +61,6 @@ def activityLoopExecution(inProcessPath,inProcessArgList,inLoopTimeEndDateTime,i
############################################################
####Функция запуска таймера - потока
############################################################
def activityLoopStart ( inActivityLoopSeconds , inProcessPath , inProcessArgList , inLoopTimeEndDateTime , inPythonPackageName , inPythonFunctionName ):
lTimer = RepeatedTimer ( inActivityLoopSeconds , activityLoopExecution , inProcessPath , inProcessArgList , inLoopTimeEndDateTime , inPythonPackageName , inPythonFunctionName ) # it auto-starts, no need of rt.start()
def activityLoopStart ( inActivityLoopSeconds , inProcessPath , inProcessArgList , inLoopTimeEndDateTime , inPythonPackageName , inPythonFunctionName ,inPythonFunctionArgList = [ ] ):
lTimer = RepeatedTimer ( inActivityLoopSeconds , activityLoopExecution , inProcessPath , inProcessArgList , inLoopTimeEndDateTime , inPythonPackageName , inPythonFunctionName ,inPythonFunctionArgList ) # it auto-starts, no need of rt.start()
lTimer . start ( )