From 28652f6d8b7e87e10783214e255cc3b6ef1bd539 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Sun, 21 Feb 2021 09:47:07 +0300 Subject: [PATCH] Orchestrator.RDPSessionCMDRun - Fix output (test), TEST Feature in FullScreen Control (before integration in Processor Queue) Logs modification --- .../Orchestrator/RobotRDPActive/Connector.py | 10 +++++----- .../Orchestrator/RobotRDPActive/RobotRDPActive.py | 13 ++++++++----- Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py | 2 +- Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py | 3 ++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Sources/pyOpenRPA/Orchestrator/RobotRDPActive/Connector.py b/Sources/pyOpenRPA/Orchestrator/RobotRDPActive/Connector.py index 16471546..eab76dfd 100644 --- a/Sources/pyOpenRPA/Orchestrator/RobotRDPActive/Connector.py +++ b/Sources/pyOpenRPA/Orchestrator/RobotRDPActive/Connector.py @@ -349,10 +349,10 @@ def SystemCMDRun(inSessionHexStr, inCMDCommandStr = "echo 1", inModeStr="CROSSCH if lClipboardStr == lInputStr: # Cross check the clipboard data and input string lRecoveryWindowRUNRetryIteratorInt = gRecoveryWindowRUNRetryCountInt # Set final count to block the loop else: # Failed - wait and retry - if lL: lL.warning(f"RDP::SystemCMDRun: Window run doesn't appear. Wait for {gRecoveryWindowRUNRetryIntervalSecInt}[s.] and retry. Current retry iterator is {lRecoveryWindowRUNRetryIteratorInt}. CMD Str: {lInputStr}") # Log the error + if lL: lL.warning(f"RDP::SystemCMDRun: RUN window (win+r) doesn't appear. Wait for {gRecoveryWindowRUNRetryIntervalSecInt}[s.] and retry. Current retry iterator is {lRecoveryWindowRUNRetryIteratorInt}. CMD Str: {lInputStr}") # Log the error lRecoveryWindowRUNRetryIteratorInt = lRecoveryWindowRUNRetryIteratorInt + 1 # Increment the iterator if lRecoveryWindowRUNRetryIteratorInt == gRecoveryWindowRUNRetryCountInt: - if lL: lL.warning(f"RDP::SystemCMDRun: Retry count is over. Raise the error. CMD Str: {lInputStr}") # Log the error + if lL: lL.warning(f"RDP::SystemCMDRun: RUN window (win+r) retry count is over. Raise the error. CMD Str: {lInputStr}") # Log the error raise ConnectorExceptions.RUNExistError() # Raise the error time.sleep(gRecoveryWindowRUNRetryIntervalSecInt) # wait for some seconds before new iteration # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -364,14 +364,14 @@ def SystemCMDRun(inSessionHexStr, inCMDCommandStr = "echo 1", inModeStr="CROSSCH if inModeStr == "CROSSCHECK" or inModeStr == "LISTEN": # Get OutStr (Case CROSSCHECK and LISTEN) lClipboardWaitTimeStartSec = time.time() lResult["OutStr"] = Clipboard.TextGet() # Get text from clipboard - while lResult["OutStr"] == lClipboardTextOld and (time.time() - lClipboardWaitTimeStartSec) <= inClipboardTimeoutSec: + while lResult["OutStr"] == f"{lClipboardTextOld} \r\n\x00\x00\x00\x00\x00" and (time.time() - lClipboardWaitTimeStartSec) <= inClipboardTimeoutSec: lResult["OutStr"] = Clipboard.TextGet() # Get text from clipboard time.sleep(0.5) # wait some time for the next operation if lResult["OutStr"] == lClipboardTextOld: # If value hasn't been changed - retry send lRecoveryCMDResponsibleRetryIteratorInt = lRecoveryCMDResponsibleRetryIteratorInt + 1 # increment the iterator if lL: lL.warning(f"RDP::SystemCMDRun: CMD command doesn't been executed (no changes in clipboard data). Wait for {gRecoveryCMDResponsibleRetryIntervalSecInt}[s.] and retry from start window RUN. Current retry iterator is {lRecoveryCMDResponsibleRetryIteratorInt}. CMD Str: {lInputStr}, Clipboard data: {lResult['OutStr']}") # Log the error if lRecoveryCMDResponsibleRetryIteratorInt >= gRecoveryCMDResponsibleRetryCountInt: # raise the error if retry count is exceeded - if lL: lL.warning(f"RDP::SystemCMDRun: Retry count is over. Raise the error.") # Log the error + if lL: lL.warning(f"RDP::SystemCMDRun: CMD command retry count is over. Raise the error.") # Log the error raise ConnectorExceptions.CMDResponsibleError() # Raise the error time.sleep(gRecoveryCMDResponsibleRetryIntervalSecInt) # wait for some seconds before new iteration else: # Data was recieved - do crosscheck @@ -384,7 +384,7 @@ def SystemCMDRun(inSessionHexStr, inCMDCommandStr = "echo 1", inModeStr="CROSSCH lRecoveryCMDResponsibleRetryIteratorInt = lRecoveryCMDResponsibleRetryIteratorInt + 1 # increment the iterator if lL: lL.warning(f"RDP::SystemCMDRun: CMD command doesn't been executed (wrong clipboard data). Wait for {gRecoveryCMDResponsibleRetryIntervalSecInt}[s.] and retry from start window RUN. Current retry iterator is {lRecoveryCMDResponsibleRetryIteratorInt}. CMD Str: {lInputStr}, Clipboard data: {lResult['OutStr']}") # Log the error if lRecoveryCMDResponsibleRetryIteratorInt >= gRecoveryCMDResponsibleRetryCountInt: # raise the error if retry count is exceeded - if lL: lL.warning(f"RDP::SystemCMDRun: Retry count is over. Raise the error.") # Log the error + if lL: lL.warning(f"RDP::SystemCMDRun: CMD command retry count is over. Raise the error.") # Log the error raise ConnectorExceptions.CMDResponsibleError() # Raise the error time.sleep(gRecoveryCMDResponsibleRetryIntervalSecInt) # wait for some seconds before new iteration else: # clipboard data has been changed but mode is not crosscheck - return success from function diff --git a/Sources/pyOpenRPA/Orchestrator/RobotRDPActive/RobotRDPActive.py b/Sources/pyOpenRPA/Orchestrator/RobotRDPActive/RobotRDPActive.py index 23bb3c41..e0707bb1 100644 --- a/Sources/pyOpenRPA/Orchestrator/RobotRDPActive/RobotRDPActive.py +++ b/Sources/pyOpenRPA/Orchestrator/RobotRDPActive/RobotRDPActive.py @@ -82,17 +82,20 @@ def RobotRDPActive(inGSettings, inThreadControlDict): for lRDPSessionKeyStrItem in inGlobalDict["RDPList"]: lRDPConfigurationDictItem = inGlobalDict["RDPList"][lRDPSessionKeyStrItem] if Connector.SessionIsFullScreen(inSessionHexStr=lRDPConfigurationDictItem["SessionHex"]): - Connector.SessionScreenSize_X_Y_W_H(inSessionHex=lRDPConfigurationDictItem["SessionHex"], inXInt=10, inYInt=10, - inWInt=550, - inHInt=350) # Prepare little window + if inThreadControlDict["ThreadExecuteBool"] == True: # TEST FEATURE BEFORE ONE THREAD INTEGRATION + Connector.SessionScreenSize_X_Y_W_H(inSessionHex=lRDPConfigurationDictItem["SessionHex"], inXInt=10, inYInt=10, + inWInt=550, + inHInt=350) # Prepare little window # Set full screen for new window - Connector.SessionScreenFull(inSessionHex=lRDPConfigurationDict["SessionHex"], inLogger= inGSettings["Logger"], inRDPConfigurationItem=inGlobalDict["RDPList"][lRDPSessionKeyStrItem]) + if inThreadControlDict["ThreadExecuteBool"] == True: # TEST FEATURE BEFORE ONE THREAD INTEGRATION + Connector.SessionScreenFull(inSessionHex=lRDPConfigurationDict["SessionHex"], inLogger= inGSettings["Logger"], inRDPConfigurationItem=inGlobalDict["RDPList"][lRDPSessionKeyStrItem]) else: # Check all RDP window and minimize it for lRDPSessionKeyStrItem in inGlobalDict["RDPList"]: lRDPConfigurationDictItem = inGlobalDict["RDPList"][lRDPSessionKeyStrItem] if Connector.SessionIsFullScreen(inSessionHexStr=lRDPConfigurationDictItem["SessionHex"]) or Connector.SessionIsMinimizedScreen(inSessionHexStr=lRDPConfigurationDictItem["SessionHex"]): # If window is minimized - restore # if window in full screen - resize - Connector.SessionScreenSize_X_Y_W_H(inSessionHex=lRDPConfigurationDictItem["SessionHex"], + if inThreadControlDict["ThreadExecuteBool"] == True: # TEST FEATURE BEFORE ONE THREAD INTEGRATION + Connector.SessionScreenSize_X_Y_W_H(inSessionHex=lRDPConfigurationDictItem["SessionHex"], inXInt=10, inYInt=10, inWInt=550, inHInt=350) # Prepare little window diff --git a/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py b/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py index bbc8d37e..224b383a 100644 --- a/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py +++ b/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py @@ -6,7 +6,7 @@ def __Create__(): "VersionStr": None, # Will be filled in orchestrator, "Autocleaner": { # Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings - "IntervalSecFloat": 600.0, # Sec float to periodically clear gsettings + "IntervalSecFloat": 3600.0, # Sec float to periodically clear gsettings }, "Client": { # Settings about client web orchestrator "Session": { diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index 1e89a1c5..710ea456 100644 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -1301,7 +1301,8 @@ def Orchestrator(inGSettings): # Orchestrator start activity if lL: lL.info("Orchestrator start activity run") #Logging for lActivityItem in gSettingsDict["OrchestratorStart"]["ActivityList"]: - Processor.ActivityListOrDict(lActivityItem) + # Processor.ActivityListOrDict(lActivityItem) + Processor.ActivityListExecute(inGSettings=gSettingsDict,inActivityList=BackwardCompatibility.v1_2_0_ProcessorOld2NewActivityDict(lActivityItem)) # Processor thread lProcessorThread = threading.Thread(target= Processor.ProcessorRunSync, kwargs={"inGSettings":gSettingsDict, "inRobotRDPThreadControlDict":lRobotRDPThreadControlDict})