#RobotRDPActive minor fix (control button in orchestrator) #Setfullscreen

#RobotScreenActive minor fin start cmd /K
dev-linux
Ivan Maslov 5 years ago
parent 21c2dd52f5
commit 2232774a3c

@ -3,19 +3,19 @@ import datetime
import logging
import os
lProcessName = "OpenRPA_RobotRDPActive.exe"
lStartFilePath = os.path.join(os.getcwd(), "..\\Utils\\RobotScreenActive\\pyOpenRPA.Tools.RobotScreenActive_x64.cmd")
lStartFilePath = os.path.join(os.getcwd(), "..\\Utils\\RobotRDPActive\\pyOpenRPA.Tools.RobotRDPActive_x64.cmd")
def RenderRobotRDPActive(inGlobalConfiguration):
#Subheader Variants
lSubheaderRunTrueText="State: <span style=\"color:green\">Turned on</span>"
lSubheaderRunFalseText="State: <span style=\"color:red\">Turned off</span>"
#Run button
#Такое большое количество слэшей связано с тем, что этот текст отправляется сначала в браузер, рендерится там, а потом отправляется на процессор оркестратора
lRobotRDPActivePath = lStartFilePath
lRobotRDPActivePath = f"start cmd /K {lStartFilePath}"
lOnClickRunButton=f"mGlobal.Controller.CMDRunText('{lRobotRDPActivePath}');"
#Safe turn off
lOnClickSafeTurnOff = "mGlobal.Processor.ServerValueSet(['Storage','RobotRDPActive','OrchestratorToRobotResetStorage','SafeTurnOff'],true);"
#Force close button
lOnClickForceCloseButton=f"mGlobal.Controller.CMDRunText('taskkill /F /im {lProcessName}.exe');"
lOnClickForceCloseButton=f"mGlobal.Controller.CMDRunText('taskkill /F /im {lProcessName}');"
#Result template
lResultDict={
"HeaderLeftText":"Keep active RDP sessions",
@ -32,16 +32,26 @@ def RenderRobotRDPActive(inGlobalConfiguration):
],
"FooterButtonX1List":[
{"Text":"Kill", "Color":"red", "Link":"", "OnClick": lOnClickForceCloseButton.replace("\\","\\\\")}
]
]#,
#"GlobalStorage": inGlobalConfiguration.get("Storage",{})
}
#Read RDPList
lRDPList = inGlobalConfiguration.get("Storage",{}).get("RobotRDPActive",{}).get("RobotToOrchestratorStorage",{}).get("RDPList",[])
lFullScreenSessionIndex = inGlobalConfiguration.get("Storage",{}).get("RobotRDPActive",{}).get("RobotToOrchestratorStorage",{}).get("FullScreenSessionIndex",None)
lRDPListIndex = 0
for lItem in lRDPList:
#Lable that session has fullscreen
lLabelSessionFullScreen = ""
#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>'
#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)}]{lItem.get('Host','localhost')}:{lItem.get('Port','--')}","Value":f"{lItem.get('Login','--')}, {lItem.get('SessionHex','--')}, State {lItemSessionState}"})
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}"})
lRDPListIndex = lRDPListIndex + 1
#Check if process running
if CheckIfProcessRunning("OpenRPA_RobotRDPActive"):
@ -69,5 +79,8 @@ def SettingsUpdate(inDict):
#Add RobotRDPActive in control panel
inDict["ControlPanelDict"]["RobotList"].append({"RenderFunction": RenderRobotRDPActive})
#Default structure
inDict["Storage"]["RobotRDPActive"]={"OrchestratorToRobotResetStorage":{"SafeTurnOff":False}}
inDict["Storage"]["RobotRDPActive"]={
"OrchestratorToRobotResetStorage":{"SafeTurnOff":False},
"OrchestratorToRobotStorage":{"FullScreenSessionIndex":None}
}
return inDict

@ -13,7 +13,7 @@ def RenderRobotScreenActive(inGlobalConfiguration):
#Такое большое количество слэшей связано с тем, что этот текст отправляется сначала в браузер, рендерится там, а потом отправляется на процессор оркестратора
import os
lRobotScreenActivePath = lStartFilePath
lOnClickRunButton=f"mGlobal.Controller.CMDRunText('{lRobotScreenActivePath}');"
lOnClickRunButton=f"mGlobal.Controller.CMDRunText('start cmd /K {lRobotScreenActivePath}');"
#Force close button
lOnClickForceCloseButton=f"mGlobal.Controller.CMDRunText('taskkill /F /im {lProcessName}');"
#Result template

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

@ -1,8 +1,8 @@
pyOpenRPA-1.0.35.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.0.35.dist-info/METADATA,sha256=Eaxc1HoYsQJpE4mC-fxUWwTQroJvDDXoEiPN-Eed6Sk,3510
pyOpenRPA-1.0.35.dist-info/RECORD,,
pyOpenRPA-1.0.35.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.0.35.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
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/Orchestrator/Orchestrator.py,sha256=UKp7eqvWDM91kYLwl2mo0UB8Pw-qu8eJCsR9NEXD1aU,6436
pyOpenRPA/Orchestrator/Processor.py,sha256=HQQyOVX-d5vPO-YULyTxVOtXtUMfvpAaSVO4xXxaKVI,9107
pyOpenRPA/Orchestrator/Server.py,sha256=dqTCK9HPhNJNgHv931uohIlW48BUvDhWMVhXaDagM1w,22134
@ -235,8 +235,8 @@ pyOpenRPA/Studio/__pycache__/Studio.cpython-37.pyc,,
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=9Y9zA92Zw9QF6dadW53NLekV_1r2STISFn5RzI08GDo,7272
pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=X8ZhJFdDnA88OHlgRuinPvhZ_eS4R7y0xRchbo7LPCc,1525
pyOpenRPA/Tools/RobotRDPActive/Connector.py,sha256=qU5SXwHgQU177MjqEHyOwJDLAcSVnIkKKw76iD09J1w,7275
pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=_exwsVgoVzN6kKFjiZfnMoq89ckc70BgfFmDMlg8fUI,2643
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=l7mCNJli_G0e_-FKJ5hBRfMvtM12pfLexUeM7c1IuZw,175
pyOpenRPA/__init__.py,sha256=45sI6ciP8porZrJBf8_tLoVCcY6ai1GpMTD79np0oKQ,175
pyOpenRPA/__pycache__/__init__.cpython-37.pyc,,

@ -81,7 +81,7 @@ def SessionRDPStart(inRDPFilePath):
[{"title": "Remote Desktop Connection", "class_name": "#32770", "backend": "win32"},
{"title": "D&on't ask me again for connections to this computer",
"friendly_class_name": "CheckBox"}],
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -96,7 +96,7 @@ def SessionRDPStart(inRDPFilePath):
{"title":"Подкл&ючить", "class_name":"Button"}]).click()
lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List(
[
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -112,7 +112,7 @@ def SessionRDPStart(inRDPFilePath):
{"title": "Co&nnect", "class_name": "Button"}]).click()
lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List(
[
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -123,13 +123,14 @@ def SessionRDPStart(inRDPFilePath):
#Set fullscreen for app
def SessionScreenFull(inSessionHex):
#Prepare little window
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow.maximize()
lRDPWindow.set_focus()
return None
#Set Little window of the session
def SessionScreen100x550(inSessionHex):
#Prepare little window
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow.restore()
lRDPWindow.move_window(10,10,550,100)
return None

@ -9,9 +9,10 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
# UIOSelector list init
lUIOSelectorList = []
for lItem in inGlobalDict["RDPList"]:
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
#Run wait command
lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout)
###########################################
#Analyze if flag safeturn off is activated
if inGlobalDict.get("OrchestratorToRobotResetStorage",{}).get("SafeTurnOff",False):
lFlagWhile=False
@ -22,6 +23,20 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
os.system('taskkill /F /im mstsc.exe')
#Return from function
return
###########################################
###########################################
#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 new session is setted
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] is not None:
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()

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs)
"""
__version__ = 'v1.0.35'
__version__ = 'v1.0.36'
__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.35
Version: 1.0.36
Summary: First open source RPA platform for business
Home-page: https://gitlab.com/UnicodeLabs/OpenRPA
Author: Ivan Maslov

@ -1,8 +1,8 @@
pyOpenRPA-1.0.35.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.0.35.dist-info/METADATA,sha256=Eaxc1HoYsQJpE4mC-fxUWwTQroJvDDXoEiPN-Eed6Sk,3510
pyOpenRPA-1.0.35.dist-info/RECORD,,
pyOpenRPA-1.0.35.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
pyOpenRPA-1.0.35.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
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/Orchestrator/Orchestrator.py,sha256=UKp7eqvWDM91kYLwl2mo0UB8Pw-qu8eJCsR9NEXD1aU,6436
pyOpenRPA/Orchestrator/Processor.py,sha256=HQQyOVX-d5vPO-YULyTxVOtXtUMfvpAaSVO4xXxaKVI,9107
pyOpenRPA/Orchestrator/Server.py,sha256=dqTCK9HPhNJNgHv931uohIlW48BUvDhWMVhXaDagM1w,22134
@ -235,8 +235,8 @@ pyOpenRPA/Studio/__pycache__/Studio.cpython-37.pyc,,
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=9Y9zA92Zw9QF6dadW53NLekV_1r2STISFn5RzI08GDo,7272
pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=X8ZhJFdDnA88OHlgRuinPvhZ_eS4R7y0xRchbo7LPCc,1525
pyOpenRPA/Tools/RobotRDPActive/Connector.py,sha256=qU5SXwHgQU177MjqEHyOwJDLAcSVnIkKKw76iD09J1w,7275
pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=_exwsVgoVzN6kKFjiZfnMoq89ckc70BgfFmDMlg8fUI,2643
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=l7mCNJli_G0e_-FKJ5hBRfMvtM12pfLexUeM7c1IuZw,175
pyOpenRPA/__init__.py,sha256=45sI6ciP8porZrJBf8_tLoVCcY6ai1GpMTD79np0oKQ,175
pyOpenRPA/__pycache__/__init__.cpython-37.pyc,,

@ -81,7 +81,7 @@ def SessionRDPStart(inRDPFilePath):
[{"title": "Remote Desktop Connection", "class_name": "#32770", "backend": "win32"},
{"title": "D&on't ask me again for connections to this computer",
"friendly_class_name": "CheckBox"}],
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -96,7 +96,7 @@ def SessionRDPStart(inRDPFilePath):
{"title":"Подкл&ючить", "class_name":"Button"}]).click()
lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List(
[
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -112,7 +112,7 @@ def SessionRDPStart(inRDPFilePath):
{"title": "Co&nnect", "class_name": "Button"}]).click()
lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List(
[
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -123,13 +123,14 @@ def SessionRDPStart(inRDPFilePath):
#Set fullscreen for app
def SessionScreenFull(inSessionHex):
#Prepare little window
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow.maximize()
lRDPWindow.set_focus()
return None
#Set Little window of the session
def SessionScreen100x550(inSessionHex):
#Prepare little window
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow.restore()
lRDPWindow.move_window(10,10,550,100)
return None

@ -9,9 +9,10 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
# UIOSelector list init
lUIOSelectorList = []
for lItem in inGlobalDict["RDPList"]:
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
#Run wait command
lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout)
###########################################
#Analyze if flag safeturn off is activated
if inGlobalDict.get("OrchestratorToRobotResetStorage",{}).get("SafeTurnOff",False):
lFlagWhile=False
@ -22,6 +23,20 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
os.system('taskkill /F /im mstsc.exe')
#Return from function
return
###########################################
###########################################
#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 new session is setted
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] is not None:
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()

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

@ -81,7 +81,7 @@ def SessionRDPStart(inRDPFilePath):
[{"title": "Remote Desktop Connection", "class_name": "#32770", "backend": "win32"},
{"title": "D&on't ask me again for connections to this computer",
"friendly_class_name": "CheckBox"}],
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -96,7 +96,7 @@ def SessionRDPStart(inRDPFilePath):
{"title":"Подкл&ючить", "class_name":"Button"}]).click()
lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List(
[
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -112,7 +112,7 @@ def SessionRDPStart(inRDPFilePath):
{"title": "Co&nnect", "class_name": "Button"}]).click()
lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List(
[
[{"title_re": f"{lRDPFileName}.*",
[{"title_re": f"{lRDPFileName}.*",
"class_name": "TscShellContainerClass", "backend": "win32"}]
],
30
@ -123,13 +123,14 @@ def SessionRDPStart(inRDPFilePath):
#Set fullscreen for app
def SessionScreenFull(inSessionHex):
#Prepare little window
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow.maximize()
lRDPWindow.set_focus()
return None
#Set Little window of the session
def SessionScreen100x550(inSessionHex):
#Prepare little window
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex}.*", "backend": "win32"}])
lRDPWindow.restore()
lRDPWindow.move_window(10,10,550,100)
return None

@ -9,9 +9,10 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
# UIOSelector list init
lUIOSelectorList = []
for lItem in inGlobalDict["RDPList"]:
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']}.*", "backend": "win32"}])
#Run wait command
lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout)
###########################################
#Analyze if flag safeturn off is activated
if inGlobalDict.get("OrchestratorToRobotResetStorage",{}).get("SafeTurnOff",False):
lFlagWhile=False
@ -22,6 +23,20 @@ def Monitor(inGlobalDict, inListUpdateTimeout):
os.system('taskkill /F /im mstsc.exe')
#Return from function
return
###########################################
###########################################
#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 new session is setted
if inGlobalDict["OrchestratorToRobotStorage"]["FullScreenSessionIndex"] is not None:
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()

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

@ -28,9 +28,10 @@ def Settings():
"FlagSessionIsActive": False
}
],
"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
},
"OrchestratorToRobotResetStorage": {
"SafeTurnOff":False #Control from orchestrator to safety turn off robot
@ -38,7 +39,7 @@ def Settings():
"OrchestratorConnector": {
#Fill below
},
"OrchestratorConnectorTerminateAll":OrchestratorConnector.IntervalTermimateAll #Call this function when program must be shutted down (to kill threads from OrchestratorConnector)
"OrchestratorConnectorTerminateAll":OrchestratorConnector.IntervalTerminateAll #Call this function when program must be shutted down (to kill threads from OrchestratorConnector)
}
######################
#OrchestratorConnector
@ -54,6 +55,16 @@ def Settings():
"OrchestratorHost": lOrchestratorHost,
"OrchestratorPort": lOrchestratorPort,
"OrchestratorAuthToken": lOrchestratorAuthToken
},
{
"Interval": 2.7,
"RobotStorage": mDict,
"RobotStorageKey": "RDPList",
"OrchestratorKeyList": ["Storage", "RobotRDPActive","RobotToOrchestratorStorage","FullScreenSessionIndex"],
"OrchestratorProtocol": lOrchestratorProtocol,
"OrchestratorHost": lOrchestratorHost,
"OrchestratorPort": lOrchestratorPort,
"OrchestratorAuthToken": lOrchestratorAuthToken
}
],
"IntervalDataReceiveResetAsync": [

@ -0,0 +1,5 @@
Çàïóñê ïðîãðàììû èç äðóãîãî îêíà êîíñîëè
https://stackoverflow.com/questions/15899798/subprocess-popen-in-different-console
import os
os.system("start cmd /K dir") #/K remains the window, /C executes and dies (popup)
Loading…
Cancel
Save