RobotRDPActive: Add Ignore functionality, minor fix

dev-linux
Ivan Maslov 5 years ago
parent 2232774a3c
commit 74c355f679

@ -2,6 +2,7 @@ import psutil
import datetime
import logging
import os
import json
lProcessName = "OpenRPA_RobotRDPActive.exe"
lStartFilePath = os.path.join(os.getcwd(), "..\\Utils\\RobotRDPActive\\pyOpenRPA.Tools.RobotRDPActive_x64.cmd")
def RenderRobotRDPActive(inGlobalConfiguration):
@ -20,7 +21,7 @@ def RenderRobotRDPActive(inGlobalConfiguration):
lResultDict={
"HeaderLeftText":"Keep active RDP sessions",
"HeaderRightText":"Tech",
"DataStorageKey":"RobotRDPActive", #Use key for set current dict in mGlobal.DataStorage["DtaaStorageKey"] on client side
"DataStorageKey":"RobotRDPActive", #Use key for set current dict in mGlobal.DataStorage["DataStorageKey"] on client side
"SubheaderText":lSubheaderRunFalseText,
"BodyKeyValueList":[
{"Key":"Session list","Value":""}
@ -42,16 +43,29 @@ def RenderRobotRDPActive(inGlobalConfiguration):
for lItem in lRDPList:
#Lable that session has fullscreen
lLabelSessionFullScreen = ""
lLabelIsIgnored = ""
#Link set full screen
##############################
lOnClickSetFullScreen = f"mGlobal.Processor.ServerValueSet(['Storage','RobotRDPActive','OrchestratorToRobotStorage','FullScreenSessionIndex'],{lRDPListIndex});"
lSetFullScreenA = f'<a onclick="{lOnClickSetFullScreen}" style=\"color:blue\">Set fullscreen</a>'
if lRDPListIndex == lFullScreenSessionIndex:
lLabelSessionFullScreen = '<span style=\"color:blue\">Fullscreen</span>'
lLabelSessionFullScreen = '<span style=\"color:blue\">[Fullscreen]</span>'
lOnClickSetFullScreen = f"mGlobal.Processor.ServerValueSet(['Storage','RobotRDPActive','OrchestratorToRobotStorage','FullScreenSessionIndex'],null);"
lSetFullScreenA = f'<a onclick="{lOnClickSetFullScreen}" style=\"color:blue\">Set minimized</a>'
#################################
lIgnoreIndexListOnClick = "$.ajax({type: 'POST', url: 'RobotRDPActive/IgnoreIndexListAppend', data: '"+str(lRDPListIndex)+"', success: function(lData,l2,l3){}, dataType: 'text'});"
lIgnoreIndexListLink = f'<a onclick="{lIgnoreIndexListOnClick}" style=\"color:red\">Ignore</a>'
#Check if in ignore
if lRDPListIndex in inGlobalConfiguration.get("Storage",{}).get("RobotRDPActive",{}).get("OrchestratorToRobotStorage",{}).get("IgnoreIndexList",[]):
lLabelIsIgnored = '<span style=\"color:red\">[Ignored]</span>'
lIgnoreIndexListOnClick = "$.ajax({type: 'POST', url: 'RobotRDPActive/IgnoreIndexListRemove', data: '"+str(lRDPListIndex)+"', success: function(lData,l2,l3){}, dataType: 'text'});"
lIgnoreIndexListLink = f'<a onclick="{lIgnoreIndexListOnClick}" style=\"color:red\">Unignore</a>'
################################
#Session state
lItemSessionState='<span style=\"color:red\">Disconnected</span>'
if lItem.get("FlagSessionIsActive",False):
lItemSessionState='<span style=\"color:green\">Connected</span>'
lResultDict["BodyKeyValueList"].append({"Key":f"[{str(lRDPListIndex)}]{lLabelSessionFullScreen}{lItem.get('Host','localhost')}:{lItem.get('Port','--')}","Value":f"{lItem.get('Login','--')}, {lItem.get('SessionHex','--')}, State {lItemSessionState}, {lSetFullScreenA}"})
lResultDict["BodyKeyValueList"].append({"Key":f"[{str(lRDPListIndex)}]{lLabelSessionFullScreen}{lLabelIsIgnored}{lItem.get('Host','localhost')}:{lItem.get('Port','--')}","Value":f"{lItem.get('Login','--')}, {lItem.get('SessionHex','--')}, State {lItemSessionState}, {lSetFullScreenA}, {lIgnoreIndexListLink}"})
lRDPListIndex = lRDPListIndex + 1
#Check if process running
if CheckIfProcessRunning("OpenRPA_RobotRDPActive"):
@ -59,7 +73,32 @@ def RenderRobotRDPActive(inGlobalConfiguration):
#Process not running
lResultDict["FooterText"]=f'Last update: {datetime.datetime.now().strftime("%H:%M:%S %d.%m.%Y")}'
return lResultDict
#Add to ignore list
def IgnoreIndexListAppend(inRequest,inConfiguration):
lIgnoreList = inConfiguration["Storage"]["RobotRDPActive"]["OrchestratorToRobotStorage"]["IgnoreIndexList"]
lIgnoreIndex={}
if inRequest.headers.get('Content-Length') is not None:
lInputByteArrayLength = int(inRequest.headers.get('Content-Length'))
lInputByteArray=inRequest.rfile.read(lInputByteArrayLength)
#Превращение массива байт в объект
lIgnoreIndex=int(lInputByteArray.decode('utf8'))
#check if index not in list
if lIgnoreIndex not in lIgnoreList:
#append to list
lIgnoreList.append(lIgnoreIndex)
#remove from Ignore list
def IgnoreIndexListRemove(inRequest,inConfiguration):
lIgnoreList = inConfiguration["Storage"]["RobotRDPActive"]["OrchestratorToRobotStorage"]["IgnoreIndexList"]
lIgnoreIndex={}
if inRequest.headers.get('Content-Length') is not None:
lInputByteArrayLength = int(inRequest.headers.get('Content-Length'))
lInputByteArray=inRequest.rfile.read(lInputByteArrayLength)
#Превращение массива байт в объект
lIgnoreIndex=int(lInputByteArray.decode('utf8'))
#check if index not in list
if lIgnoreIndex in lIgnoreList:
#append to list
lIgnoreList.remove(lIgnoreIndex) #Remove delete the element lIgnoreIndex
def CheckIfProcessRunning(processName):
'''
Check if there is any running process that contains the given name processName.
@ -81,6 +120,26 @@ def SettingsUpdate(inDict):
#Default structure
inDict["Storage"]["RobotRDPActive"]={
"OrchestratorToRobotResetStorage":{"SafeTurnOff":False},
"OrchestratorToRobotStorage":{"FullScreenSessionIndex":None}
"OrchestratorToRobotStorage":{
"FullScreenSessionIndex":None,
"IgnoreIndexList": []
}
}
#Add methods
inDict["Server"]["URLList"].append(
{
"Method":"POST",
"URL": "/RobotRDPActive/IgnoreIndexListAppend", #URL of the request
"MatchType": "Equal", #"BeginWith|Contains|Equal|EqualCase",
"ResponseDefRequestGlobal": IgnoreIndexListAppend #Function with str result
}
)
inDict["Server"]["URLList"].append(
{
"Method":"POST",
"URL": "/RobotRDPActive/IgnoreIndexListRemove", #URL of the request
"MatchType": "Equal", #"BeginWith|Contains|Equal|EqualCase",
"ResponseDefRequestGlobal": IgnoreIndexListRemove #Function with str result
}
)
return inDict

@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: pyOpenRPA
Version: 1.0.36
Version: 1.0.37
Summary: First open source RPA platform for business
Home-page: https://gitlab.com/UnicodeLabs/OpenRPA
Author: Ivan Maslov

@ -1,11 +1,11 @@
pyOpenRPA-1.0.36.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.0.36.dist-info/METADATA,sha256=njMhevPuVqHUt6Cy5LO1P47PiVpGWN1oPFhTCHyZ0vc,3510
pyOpenRPA-1.0.36.dist-info/RECORD,,
pyOpenRPA-1.0.36.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.0.36.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA-1.0.37.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.0.37.dist-info/METADATA,sha256=NvEs1xItXmuAnPaTzTs5kDpr6NhwdD4_WyFwvG9UTLo,3510
pyOpenRPA-1.0.37.dist-info/RECORD,,
pyOpenRPA-1.0.37.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.0.37.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA/Orchestrator/Orchestrator.py,sha256=UKp7eqvWDM91kYLwl2mo0UB8Pw-qu8eJCsR9NEXD1aU,6436
pyOpenRPA/Orchestrator/Processor.py,sha256=HQQyOVX-d5vPO-YULyTxVOtXtUMfvpAaSVO4xXxaKVI,9107
pyOpenRPA/Orchestrator/Server.py,sha256=dqTCK9HPhNJNgHv931uohIlW48BUvDhWMVhXaDagM1w,22134
pyOpenRPA/Orchestrator/Server.py,sha256=aWDecl4_UUU00YG-pOXxyL7IvN5NK3efABt92y6M2kg,22136
pyOpenRPA/Orchestrator/ServerSettings.py,sha256=jOXJTLwg8cJx6D-rN8J4dn5RCb2nepAhCH4F9hYVUdM,4912
pyOpenRPA/Orchestrator/Timer.py,sha256=FQZ3y6G9d47Ybx7RewzePKQV77H4gCkx5SaeFVlsuhc,2095
pyOpenRPA/Orchestrator/Web/Index.xhtml,sha256=su4tsDD_ZMbQz6Tbmqj55SM0ZZxuQw9tfPcytaB8wzs,32953
@ -236,7 +236,7 @@ pyOpenRPA/Studio/__pycache__/ValueVerify.cpython-37.pyc,,
pyOpenRPA/Studio/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/Studio/__pycache__/__main__.cpython-37.pyc,,
pyOpenRPA/Tools/RobotRDPActive/Connector.py,sha256=qU5SXwHgQU177MjqEHyOwJDLAcSVnIkKKw76iD09J1w,7275
pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=_exwsVgoVzN6kKFjiZfnMoq89ckc70BgfFmDMlg8fUI,2643
pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=H7ciateTh-hml8z69EYZjYgqdTZGkDRtnFwuYnytrCw,3278
pyOpenRPA/Tools/RobotRDPActive/Template.rdp,sha256=qPCLkjzTdYKURK7nRApkPUjRuS4K20vDPj9DIUNSSkE,2392
pyOpenRPA/Tools/RobotRDPActive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA/Tools/RobotRDPActive/__main__.py,sha256=mVk8zVqcBrzAwwn7tbZPXFWTQbWUkgU6w89nbY6GN-8,2340
@ -255,5 +255,5 @@ pyOpenRPA/Tools/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/Tools/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,,
pyOpenRPA/Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA/Tools/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/__init__.py,sha256=45sI6ciP8porZrJBf8_tLoVCcY6ai1GpMTD79np0oKQ,175
pyOpenRPA/__init__.py,sha256=32Po3gFALn9l6ft6LTFVJBkBj-1p5hP83AVcQ_FTa0s,175
pyOpenRPA/__pycache__/__init__.cpython-37.pyc,,

@ -273,7 +273,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
self.wfile.write(inResponseDict["Body"])
def do_GET(self):
# Prepare result dict
lResponseDict = {"Headers": {}, "SetCookies": {}, "Body": "", "StatusCode": None}
lResponseDict = {"Headers": {}, "SetCookies": {}, "Body": b"", "StatusCode": None}
self.OpenRPAResponseDict = lResponseDict
#####################################
#Do authentication
@ -337,7 +337,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
def do_POST(self):
# Prepare result dict
#pdb.set_trace()
lResponseDict = {"Headers": {}, "SetCookies":{}, "Body": "", "StatusCode": None}
lResponseDict = {"Headers": {}, "SetCookies":{}, "Body": b"", "StatusCode": None}
self.OpenRPAResponseDict = lResponseDict
#####################################
#Do authentication

@ -8,7 +8,8 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
while lFlagWhile:
# UIOSelector list init
lUIOSelectorList = []
for lItem in inGlobalDict["RDPList"]:
#Prepare selectors list for check
for lIndex, lItem in enumerate(inGlobalDict["RDPList"]):
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
#Run wait command
lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout)
@ -25,25 +26,30 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
return
###########################################
###########################################
for lItem in lRDPDissappearList:
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = False # Set flag that session is disconnected
#pdb.set_trace()
#Session start if it is not in ignore list
#add check for selector if it is not in ignoreIndexList
if lItem not in inGlobalDict["OrchestratorToRobotStorage"]["IgnoreIndexList"]:
try:
Connector.Session(inGlobalDict["RDPList"][lItem])
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = True # Flag that session is started
except Exception:
pass
###########################################
#Check if from Orchestrator full screen session is set
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] != inGlobalDict["FullScreenSessionIndex"]:
#Do some switches
#If full screen mode we have now
if inGlobalDict["FullScreenSessionIndex"] is not None:
Connector.SessionScreen100x550(inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["SessionHex"])
if inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["FlagSessionIsActive"]:
Connector.SessionScreen100x550(inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["SessionHex"])
#If new session is setted
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] is not None:
Connector.SessionScreenFull(inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["SessionHex"])
if inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["FlagSessionIsActive"]:
Connector.SessionScreenFull(inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["SessionHex"])
#Set one to other equal
inGlobalDict["FullScreenSessionIndex"] = inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]
###########################################
for lItem in lRDPDissappearList:
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = False # Set flag that session is disconnected
#pdb.set_trace()
#Session start
try:
Connector.Session(inGlobalDict["RDPList"][lItem])
except Exception:
pass
return None
#TODO Def garbage window cleaner (if connection was lost)

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs)
"""
__version__ = 'v1.0.36'
__version__ = 'v1.0.37'
__all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot

@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: pyOpenRPA
Version: 1.0.36
Version: 1.0.37
Summary: First open source RPA platform for business
Home-page: https://gitlab.com/UnicodeLabs/OpenRPA
Author: Ivan Maslov

@ -1,11 +1,11 @@
pyOpenRPA-1.0.36.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.0.36.dist-info/METADATA,sha256=njMhevPuVqHUt6Cy5LO1P47PiVpGWN1oPFhTCHyZ0vc,3510
pyOpenRPA-1.0.36.dist-info/RECORD,,
pyOpenRPA-1.0.36.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.0.36.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA-1.0.37.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.0.37.dist-info/METADATA,sha256=NvEs1xItXmuAnPaTzTs5kDpr6NhwdD4_WyFwvG9UTLo,3510
pyOpenRPA-1.0.37.dist-info/RECORD,,
pyOpenRPA-1.0.37.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.0.37.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA/Orchestrator/Orchestrator.py,sha256=UKp7eqvWDM91kYLwl2mo0UB8Pw-qu8eJCsR9NEXD1aU,6436
pyOpenRPA/Orchestrator/Processor.py,sha256=HQQyOVX-d5vPO-YULyTxVOtXtUMfvpAaSVO4xXxaKVI,9107
pyOpenRPA/Orchestrator/Server.py,sha256=dqTCK9HPhNJNgHv931uohIlW48BUvDhWMVhXaDagM1w,22134
pyOpenRPA/Orchestrator/Server.py,sha256=aWDecl4_UUU00YG-pOXxyL7IvN5NK3efABt92y6M2kg,22136
pyOpenRPA/Orchestrator/ServerSettings.py,sha256=jOXJTLwg8cJx6D-rN8J4dn5RCb2nepAhCH4F9hYVUdM,4912
pyOpenRPA/Orchestrator/Timer.py,sha256=FQZ3y6G9d47Ybx7RewzePKQV77H4gCkx5SaeFVlsuhc,2095
pyOpenRPA/Orchestrator/Web/Index.xhtml,sha256=su4tsDD_ZMbQz6Tbmqj55SM0ZZxuQw9tfPcytaB8wzs,32953
@ -236,7 +236,7 @@ pyOpenRPA/Studio/__pycache__/ValueVerify.cpython-37.pyc,,
pyOpenRPA/Studio/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/Studio/__pycache__/__main__.cpython-37.pyc,,
pyOpenRPA/Tools/RobotRDPActive/Connector.py,sha256=qU5SXwHgQU177MjqEHyOwJDLAcSVnIkKKw76iD09J1w,7275
pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=_exwsVgoVzN6kKFjiZfnMoq89ckc70BgfFmDMlg8fUI,2643
pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=H7ciateTh-hml8z69EYZjYgqdTZGkDRtnFwuYnytrCw,3278
pyOpenRPA/Tools/RobotRDPActive/Template.rdp,sha256=qPCLkjzTdYKURK7nRApkPUjRuS4K20vDPj9DIUNSSkE,2392
pyOpenRPA/Tools/RobotRDPActive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA/Tools/RobotRDPActive/__main__.py,sha256=mVk8zVqcBrzAwwn7tbZPXFWTQbWUkgU6w89nbY6GN-8,2340
@ -255,5 +255,5 @@ pyOpenRPA/Tools/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/Tools/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,,
pyOpenRPA/Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA/Tools/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/__init__.py,sha256=45sI6ciP8porZrJBf8_tLoVCcY6ai1GpMTD79np0oKQ,175
pyOpenRPA/__init__.py,sha256=32Po3gFALn9l6ft6LTFVJBkBj-1p5hP83AVcQ_FTa0s,175
pyOpenRPA/__pycache__/__init__.cpython-37.pyc,,

@ -273,7 +273,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
self.wfile.write(inResponseDict["Body"])
def do_GET(self):
# Prepare result dict
lResponseDict = {"Headers": {}, "SetCookies": {}, "Body": "", "StatusCode": None}
lResponseDict = {"Headers": {}, "SetCookies": {}, "Body": b"", "StatusCode": None}
self.OpenRPAResponseDict = lResponseDict
#####################################
#Do authentication
@ -337,7 +337,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
def do_POST(self):
# Prepare result dict
#pdb.set_trace()
lResponseDict = {"Headers": {}, "SetCookies":{}, "Body": "", "StatusCode": None}
lResponseDict = {"Headers": {}, "SetCookies":{}, "Body": b"", "StatusCode": None}
self.OpenRPAResponseDict = lResponseDict
#####################################
#Do authentication

@ -8,7 +8,8 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
while lFlagWhile:
# UIOSelector list init
lUIOSelectorList = []
for lItem in inGlobalDict["RDPList"]:
#Prepare selectors list for check
for lIndex, lItem in enumerate(inGlobalDict["RDPList"]):
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
#Run wait command
lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout)
@ -25,25 +26,30 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
return
###########################################
###########################################
for lItem in lRDPDissappearList:
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = False # Set flag that session is disconnected
#pdb.set_trace()
#Session start if it is not in ignore list
#add check for selector if it is not in ignoreIndexList
if lItem not in inGlobalDict["OrchestratorToRobotStorage"]["IgnoreIndexList"]:
try:
Connector.Session(inGlobalDict["RDPList"][lItem])
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = True # Flag that session is started
except Exception:
pass
###########################################
#Check if from Orchestrator full screen session is set
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] != inGlobalDict["FullScreenSessionIndex"]:
#Do some switches
#If full screen mode we have now
if inGlobalDict["FullScreenSessionIndex"] is not None:
Connector.SessionScreen100x550(inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["SessionHex"])
if inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["FlagSessionIsActive"]:
Connector.SessionScreen100x550(inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["SessionHex"])
#If new session is setted
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] is not None:
Connector.SessionScreenFull(inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["SessionHex"])
if inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["FlagSessionIsActive"]:
Connector.SessionScreenFull(inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["SessionHex"])
#Set one to other equal
inGlobalDict["FullScreenSessionIndex"] = inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]
###########################################
for lItem in lRDPDissappearList:
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = False # Set flag that session is disconnected
#pdb.set_trace()
#Session start
try:
Connector.Session(inGlobalDict["RDPList"][lItem])
except Exception:
pass
return None
#TODO Def garbage window cleaner (if connection was lost)

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs)
"""
__version__ = 'v1.0.36'
__version__ = 'v1.0.37'
__all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot

@ -273,7 +273,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
self.wfile.write(inResponseDict["Body"])
def do_GET(self):
# Prepare result dict
lResponseDict = {"Headers": {}, "SetCookies": {}, "Body": "", "StatusCode": None}
lResponseDict = {"Headers": {}, "SetCookies": {}, "Body": b"", "StatusCode": None}
self.OpenRPAResponseDict = lResponseDict
#####################################
#Do authentication
@ -337,7 +337,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
def do_POST(self):
# Prepare result dict
#pdb.set_trace()
lResponseDict = {"Headers": {}, "SetCookies":{}, "Body": "", "StatusCode": None}
lResponseDict = {"Headers": {}, "SetCookies":{}, "Body": b"", "StatusCode": None}
self.OpenRPAResponseDict = lResponseDict
#####################################
#Do authentication

@ -8,7 +8,8 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
while lFlagWhile:
# UIOSelector list init
lUIOSelectorList = []
for lItem in inGlobalDict["RDPList"]:
#Prepare selectors list for check
for lIndex, lItem in enumerate(inGlobalDict["RDPList"]):
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
#Run wait command
lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout)
@ -25,25 +26,30 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
return
###########################################
###########################################
for lItem in lRDPDissappearList:
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = False # Set flag that session is disconnected
#pdb.set_trace()
#Session start if it is not in ignore list
#add check for selector if it is not in ignoreIndexList
if lItem not in inGlobalDict["OrchestratorToRobotStorage"]["IgnoreIndexList"]:
try:
Connector.Session(inGlobalDict["RDPList"][lItem])
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = True # Flag that session is started
except Exception:
pass
###########################################
#Check if from Orchestrator full screen session is set
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] != inGlobalDict["FullScreenSessionIndex"]:
#Do some switches
#If full screen mode we have now
if inGlobalDict["FullScreenSessionIndex"] is not None:
Connector.SessionScreen100x550(inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["SessionHex"])
if inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["FlagSessionIsActive"]:
Connector.SessionScreen100x550(inGlobalDict["RDPList"][inGlobalDict["FullScreenSessionIndex"]]["SessionHex"])
#If new session is setted
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] is not None:
Connector.SessionScreenFull(inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["SessionHex"])
if inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["FlagSessionIsActive"]:
Connector.SessionScreenFull(inGlobalDict["RDPList"][inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]]["SessionHex"])
#Set one to other equal
inGlobalDict["FullScreenSessionIndex"] = inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"]
###########################################
for lItem in lRDPDissappearList:
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = False # Set flag that session is disconnected
#pdb.set_trace()
#Session start
try:
Connector.Session(inGlobalDict["RDPList"][lItem])
except Exception:
pass
return None
#TODO Def garbage window cleaner (if connection was lost)

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs)
"""
__version__ = 'v1.0.36'
__version__ = 'v1.0.37'
__all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot

@ -31,7 +31,8 @@ def Settings():
"FullScreenSessionIndex": None, #Index of the current session which is full screened, None is no session in fullscreen
"Logger": logging.getLogger("RobotRDPActive"),
"OrchestratorToRobotStorage": {
"FullScreenSessionIndex":None #Index of the session which is full screen in GUI. None if no session in full screen
"FullScreenSessionIndex":None, #Index of the session which is full screen in GUI. None if no session in full screen
"IgnoreIndexList":[]
},
"OrchestratorToRobotResetStorage": {
"SafeTurnOff":False #Control from orchestrator to safety turn off robot
@ -82,7 +83,7 @@ def Settings():
],
"IntervalDataReceiveAsync": [
{
"Interval": 3.6,
"Interval": 1.5,
"RobotStorage": mDict,
"RobotStorageKey": "OrchestratorToRobotStorage",
"OrchestratorKeyList": ["Storage", "RobotRDPActive","OrchestratorToRobotStorage"],

@ -1,4 +1,6 @@
Beta before 1.1.0 (new way of OpenRPA with improovments. Sorry, but no backward compatibility)/ Backward compatibility will start from 1.0.1
[1.0.37]
Minor fix in RobotRDPActive
[1.0.33]
Manu changes - look git
[1.0.31]

Loading…
Cancel
Save