diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/INSTALLER b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/INSTALLER similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/INSTALLER rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/INSTALLER diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/METADATA b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/METADATA similarity index 99% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/METADATA rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/METADATA index c0435c84..901f7dff 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/METADATA +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyOpenRPA -Version: 1.0.27 +Version: 1.0.28 Summary: First open source RPA platform for business Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Author: Ivan Maslov diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/RECORD b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/RECORD similarity index 97% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/RECORD rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/RECORD index 1b785355..f0dd4fd2 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/RECORD +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/RECORD @@ -1,3 +1,4 @@ +../../Template.rdp,sha256=qPCLkjzTdYKURK7nRApkPUjRuS4K20vDPj9DIUNSSkE,2392 ../../pyOpenRPA/Orchestrator/Web/Index.xhtml,sha256=JaHn6K7wXkK6K0qYrfcRjVQDhgWA8_qR_YzIqqDDp9w,31297 ../../pyOpenRPA/Orchestrator/Web/favicon.ico,sha256=jO3pjFWbmJEPQ2KroXSKYtXIesBq46PCBlKSouewODU,5430 ../../pyOpenRPA/Resources/Web/Google/LatoItalic.css,sha256=pB6OZ6F2VsaqkL-g5hW-wE_T0m9H_NltzmzjX-XAKDk,3112 @@ -174,11 +175,11 @@ ../../pyOpenRPA/Resources/Web/jQuery/jquery-3.1.1.min.js,sha256=HPMOWdIdSuVgr3FD9ZE-_MgiK8qk_MdQjrgCtfqp6U4,86713 ../../pyOpenRPA/Studio/Web/Index.xhtml,sha256=74z3eWlmB6Yedbp91xgGtDjymUSlBcduAQ09ZxQ67f8,44241 ../../pyOpenRPA/Studio/Web/favicon.ico,sha256=0vdsnwKGh6pgB0FDB5mOKO7RwbxQ9F13Zg16F1pkvXs,5430 -pyOpenRPA-1.0.27.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -pyOpenRPA-1.0.27.dist-info/METADATA,sha256=_Y3EhPYpKcvrrAWGgh0dkV-QqKaADkkSh7eOMoz0xcw,3510 -pyOpenRPA-1.0.27.dist-info/RECORD,, -pyOpenRPA-1.0.27.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 -pyOpenRPA-1.0.27.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 +pyOpenRPA-1.0.28.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyOpenRPA-1.0.28.dist-info/METADATA,sha256=hAICqEoUMLFar4d6j2IkfuYWTBYZuL6DMlP8p2UFZPA,3510 +pyOpenRPA-1.0.28.dist-info/RECORD,, +pyOpenRPA-1.0.28.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 +pyOpenRPA-1.0.28.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 pyOpenRPA/Orchestrator/Orchestrator.py,sha256=mlxsd8YMs9X_Een8HfOlCv5d_LVgcx21UAQphHFfD_M,6689 pyOpenRPA/Orchestrator/Processor.py,sha256=GHXwC1B2py4mAtk9oZa-FVSJhx3no9oD2bvkj20uhNA,9051 pyOpenRPA/Orchestrator/Server.py,sha256=GH7P0L-83ONlRdVYu3oQqt2oCgXPXYjrcFb0tY_6SYU,12878 @@ -403,15 +404,18 @@ 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/RDPConnector.py,sha256=sU79Pd4ehuubZohzUFxkuFOo79Xhicr3sY1HhKaeRhg,1903 -pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py,sha256=BjLCZW8fJkoHISJi_ygDG5aBl5jLdOrRolsj3wL7vww,84 +pyOpenRPA/Tools/RobotRDPActive/Connector.py,sha256=n5QFnPdomMiN3AuiORopw9p7nPsgDcgrjbhICL_YjQg,6154 +pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=INkiX4Gi4KjvWRoe4jWV_NJGKgjDId6zEyqBHpegUxw,760 +pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py,sha256=5eEhjk7NDXf9Q4yvkeRICE7x9npiMkazuMITQX24Ooc,857 +pyOpenRPA/Tools/RobotRDPActive/Template.rdp,sha256=qPCLkjzTdYKURK7nRApkPUjRuS4K20vDPj9DIUNSSkE,2392 pyOpenRPA/Tools/RobotRDPActive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pyOpenRPA/Tools/RobotRDPActive/__main__.py,sha256=bQZTpQoc50J4UaSRGTSQS2ZAY3iG4eLNaVTc6axXJJ8,834 -pyOpenRPA/Tools/RobotRDPActive/__pycache__/RDPConnector.cpython-37.pyc,, +pyOpenRPA/Tools/RobotRDPActive/__main__.py,sha256=qC_LyXI2MjJkidTRpV3abyyPO0qASGTvNkeAkfnA7J0,2108 +pyOpenRPA/Tools/RobotRDPActive/__pycache__/Connector.cpython-37.pyc,, +pyOpenRPA/Tools/RobotRDPActive/__pycache__/Monitor.cpython-37.pyc,, pyOpenRPA/Tools/RobotRDPActive/__pycache__/SettingsExample.cpython-37.pyc,, pyOpenRPA/Tools/RobotRDPActive/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Tools/RobotRDPActive/__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=8FWo2oWf0H8ujn6HQxmH46hGU0R2CTg7nUDUXHnqPoE,175 +pyOpenRPA/__init__.py,sha256=QaZLtEFmId80mzETuHRPDE3ZM9c6bmuE6S6bcq8MyEU,175 pyOpenRPA/__pycache__/__init__.cpython-37.pyc,, diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/WHEEL b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/WHEEL similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/WHEEL rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/WHEEL diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/top_level.txt b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/top_level.txt similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/top_level.txt rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/top_level.txt diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Connector.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Connector.py new file mode 100644 index 00000000..0282360d --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Connector.py @@ -0,0 +1,116 @@ +#Import parent folder to import current / other packages +from pyOpenRPA.Robot import UIDesktop #Lib to access RDP window +import os #os for process run +import uuid #temp id for Template.rdp +import tempfile #Temporary location +import time +import subprocess +#Connect to RDP session +""" +{ + "Host": "", #Host address + "Port": "", #RDP Port + "Login": "", # Login + "Password": "", #Password + "Screen": { + "Resolution":"FullScreen", #"640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen + "FlagUseAllMonitors": False, # True or False + "DepthBit":"" #"32" or "24" or "16" or "15" + } +} +""" +def Session(inRDPSessionConfiguration): + #RDPConnector.SessionConnect(mConfiguration) + #RDPConnector.LoginPassSet("111.222.222.111","ww","dd") + (lRDPFile, lSessionHex) = SessionConfigurationCreate(inRDPSessionConfiguration) + #Set session hex in globalDict + inRDPSessionConfiguration["SessionHex"] = lSessionHex + #Set login/password + SessionLoginPasswordSet(inRDPSessionConfiguration["Host"],inRDPSessionConfiguration["Login"],inRDPSessionConfiguration["Password"]) + #Start session + SessionRDPStart(lRDPFile) + #Remove temp file + time.sleep(4) #Delete file after some delay - one way to delete and run the RDP before because RDP is not read file in one moment + os.remove(lRDPFile) # delete the temp rdp + return inRDPSessionConfiguration +#Add login/ password to the windows credentials to run RDP +def SessionLoginPasswordSet(inHost, inLogin, inPassword): + #Clear old login/password if it exists + #os.system(f"cmdkey /delete:TERMSRV/{inHost}") #Dont need to delete because new user password will clear the previous creds + #Set login password for host + os.system(f"cmdkey /generic:TERMSRV/{inHost} /user:{inLogin} /pass:{inPassword}") + return None +#Create current .rdp file with settings +#Return (full path to file, session hex) +def SessionConfigurationCreate(inConfiguration): + #RobotRDPActive folder path + lFileFullPath=__file__ + lFileFullPath = lFileFullPath.replace("/","\\") + lRobotRDPActiveFolderPath = "\\".join(lFileFullPath.split("\\")[:-1]) + #Full path to Template.rdp file + lRDPTemplateFileFullPath = os.path.join(lRobotRDPActiveFolderPath, "Template.rdp") + #Open template file (.rdp encoding is USC-2 LE BOM = UTF-16 LE) http://qaru.site/questions/7156020/python-writing-a-ucs-2-little-endian-utf-16-le-file-with-bom + lRDPTemplateFileContent = open(lRDPTemplateFileFullPath, "r", encoding="utf-16-le").read() + #Prepare host:port + lHostPort=inConfiguration['Host'] + if 'Port' in inConfiguration: + if inConfiguration['Port']: + lHostPort=f"{lHostPort}:{inConfiguration['Port']}" + #Replace {Width}, {Height}, {BitDepth}, {HostPort}, {Login} + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Width}", inConfiguration.get('Screen',{}).get("Width",1680)) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Height}", inConfiguration.get('Screen',{}).get("Height",1050)) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{BitDepth}", inConfiguration.get('Screen',{}).get("DepthBit","32")) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{HostPort}", lHostPort) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Login}", inConfiguration['Login']) + #Save template to temp file + lRDPCurrentFileFullPath = os.path.join(tempfile.gettempdir(), f"{uuid.uuid4().hex}.rdp") + open(lRDPCurrentFileFullPath, "w", encoding="utf-16-le").write(lRDPTemplateFileContent) + #Return .rdp full path + return (lRDPCurrentFileFullPath, (lRDPCurrentFileFullPath.split("\\")[-1])[0:-4]) +#RDPSessionStart +def SessionRDPStart(inRDPFilePath): + #run rdp session + lItemArgs = [inRDPFilePath] + subprocess.Popen(lItemArgs, shell=True) + #Wait for UAC unknown publisher exists + lRDPFileName = (inRDPFilePath.split("\\")[-1])[0:-4] + lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List( + [ + [{"title": "Подключение к удаленному рабочему столу", "class_name": "#32770", "backend": "win32"}, + {"title": "Боль&ше не выводить запрос о подключениях к этому компьютеру", "friendly_class_name": "CheckBox"}], + [{"title_re": f"{lRDPFileName} — .*", + "class_name": "TscShellContainerClass", "backend": "win32"}] + ], + 60 + ) + #Click if 0 is appear + if 0 in lWaitResult: + #Check the box do not retry + UIDesktop.UIOSelector_Get_UIO([{"title": "Подключение к удаленному рабочему столу", "backend": "win32"}, + {"title": "Боль&ше не выводить запрос о подключениях к этому компьютеру", "friendly_class_name": "CheckBox"}]).check() + #Go to connection + UIDesktop.UIOSelector_Get_UIO([{"title": "Подключение к удаленному рабочему столу", "backend": "win32"}, + {"title":"Подкл&ючить", "class_name":"Button"}]).click() + lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List( + [ + [{"title_re": f"{lRDPFileName} — .*", + "class_name": "TscShellContainerClass", "backend": "win32"}] + ], + 60 + ) + #Prepare little window + SessionScreen100x550(lRDPFileName) + return None +#Set fullscreen for app +def SessionScreenFull(inSessionHex): + #Prepare little window + lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex} — .*", "backend": "win32"}]) + lRDPWindow.maximize() + 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.restore() + lRDPWindow.move_window(10,10,550,100) + return None diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Monitor.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Monitor.py new file mode 100644 index 00000000..3d7f5b93 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Monitor.py @@ -0,0 +1,17 @@ +from pyOpenRPA.Robot import UIDesktop +from . import Connector +import pdb +#Check for session is closed. Reopen if detected. Always keep session is active +def Monitor(inGlobalDict, inListUpdateTimeout): + while True: + # UIOSelector list init + lUIOSelectorList = [] + for lItem in inGlobalDict["RDPList"]: + lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']} — .*", "backend": "win32"}]) + #Run wait command + lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout) + for lItem in lRDPDissappearList: + #pdb.set_trace() + #Session start + Connector.Session(inGlobalDict["RDPList"][lItem]) + return None \ No newline at end of file diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/RDPConnector.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/RDPConnector.py deleted file mode 100644 index 1d751b20..00000000 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/RDPConnector.py +++ /dev/null @@ -1,50 +0,0 @@ -#Import parent folder to import current / other packages -from pyOpenRPA.Robot import UIDesktop #Lib to access RDP window -import os #os for process run -import time -#Connect to RDP session -""" -{ - "Host": "", #Host address - "Port": "", #RDP Port - "Login": "", # Login - "Password": "", #Password - "Screen": { - "Resolution":"FullScreen", #"640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen - "FlagUseAllMonitors": False, # True or False - "DepthBit":"" #"32" or "24" or "16" or "15" - } -} -""" -def SessionConnect(inRDPSessionConfiguration): - #Run mstsc - from pywinauto.application import Application - lRDPApplication = Application(backend="uia").start("mstsc.exe") - lProcessId = lRDPApplication.process - #Expand the parameter section - UIDesktop.UIOSelector_Get_UIO( - [ - {"process": lProcessId, "backend": "uia"}, - {"class_name": "ToolbarWindow32"}, - {"title": "Показать параметры ", "control_type": "Button"}] - ).click() - #Select flag ask login/pass - UIDesktop.UIOSelector_Get_UIO( - [ - {"process": lProcessId, "backend": "win32"}, - {"title":"Общие"}, - {"title":"Учетные данные"}, - {"title":"&Всегда запрашивать учетные данные", "class_name":"Button"}] - ).check() - #Set host:port - lHostPort=inRDPSessionConfiguration['Host'] - if 'Port' in inRDPSessionConfiguration: - lHostPort=f"{lHostPort}:{inRDPSessionConfiguration['Port']}" - UIDesktop.UIOSelector_Get_UIO( - [ - {"process": lProcessId, "backend": "uia"}, - {"title": "Компьютер:"}, - {"title": "Компьютер:", "control_type": "Edit"}] - ).set_text(f"{lHostPort}") - #Set user - diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py index 549e7d43..02deb771 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py @@ -1,6 +1,22 @@ #Robot RDPActive settings def Settings(): mDict = { - + "RDPList": + [ + { + "Host": "77.77.22.22", # Host address + "Port": "7777", # RDP Port + "Login": "test", # Login + "Password": "test", # Password + "Screen": { + "Width": 1680, #Width of the remote desktop in pixels + "Height": 1050, #Height of the remote desktop in pixels + # "640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen + "FlagUseAllMonitors": False, # True or False + "DepthBit": "32" # "32" or "24" or "16" or "15" + }, + "SessionHex":"" # Hex is created when robot runs + } + ] } return mDict \ No newline at end of file diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Template.rdp b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Template.rdp new file mode 100644 index 00000000..10193862 Binary files /dev/null and b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Template.rdp differ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/__main__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/__main__.py index 2e5729ef..a3d0fe99 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/__main__.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/__main__.py @@ -1,20 +1,43 @@ +#Run example +#cd %~dp0..\..\Sources +#..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe -m pyOpenRPA.Tools.RobotRDPActive "C:\Abs\Archive\scopeSrcUL\Settings.py" +#pause >nul #Import parent folder to import current / other packages ######################################################### import sys +import subprocess #start process async +import os #path, run, remove +import time #timer +import importlib #lFolderPath = "\\".join(__file__.split("\\")[:-4]) lFolderPath = "/".join(__file__.split("/")[:-4]) sys.path.insert(0, lFolderPath) +#Единый глобальный словарь (За основу взять из Settings.py) +global mGlobalDict +#Call Settings function from argv[1] file +################################################ +lSubmoduleFunctionName = "Settings" +lFileFullPath = sys.argv[1] +lModuleName = (lFileFullPath.split("\\")[-1])[0:-3] +lTechSpecification = importlib.util.spec_from_file_location(lModuleName, lFileFullPath) +lTechModuleFromSpec = importlib.util.module_from_spec(lTechSpecification) +lTechSpecificationModuleLoader = lTechSpecification.loader.exec_module(lTechModuleFromSpec) +mGlobalDict = None +if lSubmoduleFunctionName in dir(lTechModuleFromSpec): + # Run SettingUpdate function in submodule + mGlobalDict = getattr(lTechModuleFromSpec, lSubmoduleFunctionName)() +################################################# ######################################################### -from pyOpenRPA.Tools.RobotRDPActive import RDPConnector -mConfiguration={ - "Host": "77.77.22.22", #Host address - "Port": "7777", #RDP Port - "Login": "test", # Login - "Password": "test", #Password - "Screen": { - "Resolution":"FullScreen", #"640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen - "FlagUseAllMonitors": False, # True or False - "DepthBit":"" #"32" or "24" or "16" or "15" - } -} -RDPConnector.SessionConnect(mConfiguration) \ No newline at end of file +from pyOpenRPA.Tools.RobotRDPActive import Connector +from pyOpenRPA.Tools.RobotRDPActive import Monitor +#Disable certificate warning +lCMDString = 'reg add "HKEY_CURRENT_USER\\Software\\Microsoft\\Terminal Server Client" /v "AuthenticationLevelOverride" /t "REG_DWORD" /d 0 /f' +os.system(lCMDString) +#time.sleep() +for lConfigurationItem in mGlobalDict["RDPList"]: + Connector.Session(lConfigurationItem) +#Run monitor +Monitor.Monitor(mGlobalDict, 1) +#Enable certificate warning +lCMDString = 'reg add "HKEY_CURRENT_USER\\Software\\Microsoft\\Terminal Server Client" /v "AuthenticationLevelOverride" /t "REG_DWORD" /d 2 /f' +os.system(lCMDString) \ No newline at end of file diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/__init__.py index 4cb9341d..a200a5bd 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/__init__.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/__init__.py @@ -3,7 +3,7 @@ r""" The OpenRPA package (from UnicodeLabs) """ -__version__ = 'v1.0.27' +__version__ = 'v1.0.28' __all__ = [] __author__ = 'Ivan Maslov ' #from .Core import Robot \ No newline at end of file diff --git a/Resources/WPy32-3720/python-3.7.2/Template.rdp b/Resources/WPy32-3720/python-3.7.2/Template.rdp new file mode 100644 index 00000000..10193862 Binary files /dev/null and b/Resources/WPy32-3720/python-3.7.2/Template.rdp differ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/INSTALLER b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/INSTALLER similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/INSTALLER rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/INSTALLER diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/METADATA b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/METADATA similarity index 99% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/METADATA rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/METADATA index c0435c84..901f7dff 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/METADATA +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyOpenRPA -Version: 1.0.27 +Version: 1.0.28 Summary: First open source RPA platform for business Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Author: Ivan Maslov diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/RECORD b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/RECORD similarity index 97% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/RECORD rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/RECORD index 1b785355..f0dd4fd2 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/RECORD +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/RECORD @@ -1,3 +1,4 @@ +../../Template.rdp,sha256=qPCLkjzTdYKURK7nRApkPUjRuS4K20vDPj9DIUNSSkE,2392 ../../pyOpenRPA/Orchestrator/Web/Index.xhtml,sha256=JaHn6K7wXkK6K0qYrfcRjVQDhgWA8_qR_YzIqqDDp9w,31297 ../../pyOpenRPA/Orchestrator/Web/favicon.ico,sha256=jO3pjFWbmJEPQ2KroXSKYtXIesBq46PCBlKSouewODU,5430 ../../pyOpenRPA/Resources/Web/Google/LatoItalic.css,sha256=pB6OZ6F2VsaqkL-g5hW-wE_T0m9H_NltzmzjX-XAKDk,3112 @@ -174,11 +175,11 @@ ../../pyOpenRPA/Resources/Web/jQuery/jquery-3.1.1.min.js,sha256=HPMOWdIdSuVgr3FD9ZE-_MgiK8qk_MdQjrgCtfqp6U4,86713 ../../pyOpenRPA/Studio/Web/Index.xhtml,sha256=74z3eWlmB6Yedbp91xgGtDjymUSlBcduAQ09ZxQ67f8,44241 ../../pyOpenRPA/Studio/Web/favicon.ico,sha256=0vdsnwKGh6pgB0FDB5mOKO7RwbxQ9F13Zg16F1pkvXs,5430 -pyOpenRPA-1.0.27.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -pyOpenRPA-1.0.27.dist-info/METADATA,sha256=_Y3EhPYpKcvrrAWGgh0dkV-QqKaADkkSh7eOMoz0xcw,3510 -pyOpenRPA-1.0.27.dist-info/RECORD,, -pyOpenRPA-1.0.27.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 -pyOpenRPA-1.0.27.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 +pyOpenRPA-1.0.28.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyOpenRPA-1.0.28.dist-info/METADATA,sha256=hAICqEoUMLFar4d6j2IkfuYWTBYZuL6DMlP8p2UFZPA,3510 +pyOpenRPA-1.0.28.dist-info/RECORD,, +pyOpenRPA-1.0.28.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 +pyOpenRPA-1.0.28.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 pyOpenRPA/Orchestrator/Orchestrator.py,sha256=mlxsd8YMs9X_Een8HfOlCv5d_LVgcx21UAQphHFfD_M,6689 pyOpenRPA/Orchestrator/Processor.py,sha256=GHXwC1B2py4mAtk9oZa-FVSJhx3no9oD2bvkj20uhNA,9051 pyOpenRPA/Orchestrator/Server.py,sha256=GH7P0L-83ONlRdVYu3oQqt2oCgXPXYjrcFb0tY_6SYU,12878 @@ -403,15 +404,18 @@ 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/RDPConnector.py,sha256=sU79Pd4ehuubZohzUFxkuFOo79Xhicr3sY1HhKaeRhg,1903 -pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py,sha256=BjLCZW8fJkoHISJi_ygDG5aBl5jLdOrRolsj3wL7vww,84 +pyOpenRPA/Tools/RobotRDPActive/Connector.py,sha256=n5QFnPdomMiN3AuiORopw9p7nPsgDcgrjbhICL_YjQg,6154 +pyOpenRPA/Tools/RobotRDPActive/Monitor.py,sha256=INkiX4Gi4KjvWRoe4jWV_NJGKgjDId6zEyqBHpegUxw,760 +pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py,sha256=5eEhjk7NDXf9Q4yvkeRICE7x9npiMkazuMITQX24Ooc,857 +pyOpenRPA/Tools/RobotRDPActive/Template.rdp,sha256=qPCLkjzTdYKURK7nRApkPUjRuS4K20vDPj9DIUNSSkE,2392 pyOpenRPA/Tools/RobotRDPActive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pyOpenRPA/Tools/RobotRDPActive/__main__.py,sha256=bQZTpQoc50J4UaSRGTSQS2ZAY3iG4eLNaVTc6axXJJ8,834 -pyOpenRPA/Tools/RobotRDPActive/__pycache__/RDPConnector.cpython-37.pyc,, +pyOpenRPA/Tools/RobotRDPActive/__main__.py,sha256=qC_LyXI2MjJkidTRpV3abyyPO0qASGTvNkeAkfnA7J0,2108 +pyOpenRPA/Tools/RobotRDPActive/__pycache__/Connector.cpython-37.pyc,, +pyOpenRPA/Tools/RobotRDPActive/__pycache__/Monitor.cpython-37.pyc,, pyOpenRPA/Tools/RobotRDPActive/__pycache__/SettingsExample.cpython-37.pyc,, pyOpenRPA/Tools/RobotRDPActive/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Tools/RobotRDPActive/__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=8FWo2oWf0H8ujn6HQxmH46hGU0R2CTg7nUDUXHnqPoE,175 +pyOpenRPA/__init__.py,sha256=QaZLtEFmId80mzETuHRPDE3ZM9c6bmuE6S6bcq8MyEU,175 pyOpenRPA/__pycache__/__init__.cpython-37.pyc,, diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/WHEEL b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/WHEEL similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/WHEEL rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/WHEEL diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/top_level.txt b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/top_level.txt similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.27.dist-info/top_level.txt rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.28.dist-info/top_level.txt diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Connector.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Connector.py new file mode 100644 index 00000000..0282360d --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Connector.py @@ -0,0 +1,116 @@ +#Import parent folder to import current / other packages +from pyOpenRPA.Robot import UIDesktop #Lib to access RDP window +import os #os for process run +import uuid #temp id for Template.rdp +import tempfile #Temporary location +import time +import subprocess +#Connect to RDP session +""" +{ + "Host": "", #Host address + "Port": "", #RDP Port + "Login": "", # Login + "Password": "", #Password + "Screen": { + "Resolution":"FullScreen", #"640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen + "FlagUseAllMonitors": False, # True or False + "DepthBit":"" #"32" or "24" or "16" or "15" + } +} +""" +def Session(inRDPSessionConfiguration): + #RDPConnector.SessionConnect(mConfiguration) + #RDPConnector.LoginPassSet("111.222.222.111","ww","dd") + (lRDPFile, lSessionHex) = SessionConfigurationCreate(inRDPSessionConfiguration) + #Set session hex in globalDict + inRDPSessionConfiguration["SessionHex"] = lSessionHex + #Set login/password + SessionLoginPasswordSet(inRDPSessionConfiguration["Host"],inRDPSessionConfiguration["Login"],inRDPSessionConfiguration["Password"]) + #Start session + SessionRDPStart(lRDPFile) + #Remove temp file + time.sleep(4) #Delete file after some delay - one way to delete and run the RDP before because RDP is not read file in one moment + os.remove(lRDPFile) # delete the temp rdp + return inRDPSessionConfiguration +#Add login/ password to the windows credentials to run RDP +def SessionLoginPasswordSet(inHost, inLogin, inPassword): + #Clear old login/password if it exists + #os.system(f"cmdkey /delete:TERMSRV/{inHost}") #Dont need to delete because new user password will clear the previous creds + #Set login password for host + os.system(f"cmdkey /generic:TERMSRV/{inHost} /user:{inLogin} /pass:{inPassword}") + return None +#Create current .rdp file with settings +#Return (full path to file, session hex) +def SessionConfigurationCreate(inConfiguration): + #RobotRDPActive folder path + lFileFullPath=__file__ + lFileFullPath = lFileFullPath.replace("/","\\") + lRobotRDPActiveFolderPath = "\\".join(lFileFullPath.split("\\")[:-1]) + #Full path to Template.rdp file + lRDPTemplateFileFullPath = os.path.join(lRobotRDPActiveFolderPath, "Template.rdp") + #Open template file (.rdp encoding is USC-2 LE BOM = UTF-16 LE) http://qaru.site/questions/7156020/python-writing-a-ucs-2-little-endian-utf-16-le-file-with-bom + lRDPTemplateFileContent = open(lRDPTemplateFileFullPath, "r", encoding="utf-16-le").read() + #Prepare host:port + lHostPort=inConfiguration['Host'] + if 'Port' in inConfiguration: + if inConfiguration['Port']: + lHostPort=f"{lHostPort}:{inConfiguration['Port']}" + #Replace {Width}, {Height}, {BitDepth}, {HostPort}, {Login} + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Width}", inConfiguration.get('Screen',{}).get("Width",1680)) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Height}", inConfiguration.get('Screen',{}).get("Height",1050)) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{BitDepth}", inConfiguration.get('Screen',{}).get("DepthBit","32")) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{HostPort}", lHostPort) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Login}", inConfiguration['Login']) + #Save template to temp file + lRDPCurrentFileFullPath = os.path.join(tempfile.gettempdir(), f"{uuid.uuid4().hex}.rdp") + open(lRDPCurrentFileFullPath, "w", encoding="utf-16-le").write(lRDPTemplateFileContent) + #Return .rdp full path + return (lRDPCurrentFileFullPath, (lRDPCurrentFileFullPath.split("\\")[-1])[0:-4]) +#RDPSessionStart +def SessionRDPStart(inRDPFilePath): + #run rdp session + lItemArgs = [inRDPFilePath] + subprocess.Popen(lItemArgs, shell=True) + #Wait for UAC unknown publisher exists + lRDPFileName = (inRDPFilePath.split("\\")[-1])[0:-4] + lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List( + [ + [{"title": "Подключение к удаленному рабочему столу", "class_name": "#32770", "backend": "win32"}, + {"title": "Боль&ше не выводить запрос о подключениях к этому компьютеру", "friendly_class_name": "CheckBox"}], + [{"title_re": f"{lRDPFileName} — .*", + "class_name": "TscShellContainerClass", "backend": "win32"}] + ], + 60 + ) + #Click if 0 is appear + if 0 in lWaitResult: + #Check the box do not retry + UIDesktop.UIOSelector_Get_UIO([{"title": "Подключение к удаленному рабочему столу", "backend": "win32"}, + {"title": "Боль&ше не выводить запрос о подключениях к этому компьютеру", "friendly_class_name": "CheckBox"}]).check() + #Go to connection + UIDesktop.UIOSelector_Get_UIO([{"title": "Подключение к удаленному рабочему столу", "backend": "win32"}, + {"title":"Подкл&ючить", "class_name":"Button"}]).click() + lWaitResult = UIDesktop.UIOSelectorsSecs_WaitAppear_List( + [ + [{"title_re": f"{lRDPFileName} — .*", + "class_name": "TscShellContainerClass", "backend": "win32"}] + ], + 60 + ) + #Prepare little window + SessionScreen100x550(lRDPFileName) + return None +#Set fullscreen for app +def SessionScreenFull(inSessionHex): + #Prepare little window + lRDPWindow = UIDesktop.UIOSelector_Get_UIO([{"title_re": f"{inSessionHex} — .*", "backend": "win32"}]) + lRDPWindow.maximize() + 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.restore() + lRDPWindow.move_window(10,10,550,100) + return None diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Monitor.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Monitor.py new file mode 100644 index 00000000..3d7f5b93 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Monitor.py @@ -0,0 +1,17 @@ +from pyOpenRPA.Robot import UIDesktop +from . import Connector +import pdb +#Check for session is closed. Reopen if detected. Always keep session is active +def Monitor(inGlobalDict, inListUpdateTimeout): + while True: + # UIOSelector list init + lUIOSelectorList = [] + for lItem in inGlobalDict["RDPList"]: + lUIOSelectorList.append([{"title_re": f"{lItem['SessionHex']} — .*", "backend": "win32"}]) + #Run wait command + lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout) + for lItem in lRDPDissappearList: + #pdb.set_trace() + #Session start + Connector.Session(inGlobalDict["RDPList"][lItem]) + return None \ No newline at end of file diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/RDPConnector.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/RDPConnector.py deleted file mode 100644 index 1d751b20..00000000 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/RDPConnector.py +++ /dev/null @@ -1,50 +0,0 @@ -#Import parent folder to import current / other packages -from pyOpenRPA.Robot import UIDesktop #Lib to access RDP window -import os #os for process run -import time -#Connect to RDP session -""" -{ - "Host": "", #Host address - "Port": "", #RDP Port - "Login": "", # Login - "Password": "", #Password - "Screen": { - "Resolution":"FullScreen", #"640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen - "FlagUseAllMonitors": False, # True or False - "DepthBit":"" #"32" or "24" or "16" or "15" - } -} -""" -def SessionConnect(inRDPSessionConfiguration): - #Run mstsc - from pywinauto.application import Application - lRDPApplication = Application(backend="uia").start("mstsc.exe") - lProcessId = lRDPApplication.process - #Expand the parameter section - UIDesktop.UIOSelector_Get_UIO( - [ - {"process": lProcessId, "backend": "uia"}, - {"class_name": "ToolbarWindow32"}, - {"title": "Показать параметры ", "control_type": "Button"}] - ).click() - #Select flag ask login/pass - UIDesktop.UIOSelector_Get_UIO( - [ - {"process": lProcessId, "backend": "win32"}, - {"title":"Общие"}, - {"title":"Учетные данные"}, - {"title":"&Всегда запрашивать учетные данные", "class_name":"Button"}] - ).check() - #Set host:port - lHostPort=inRDPSessionConfiguration['Host'] - if 'Port' in inRDPSessionConfiguration: - lHostPort=f"{lHostPort}:{inRDPSessionConfiguration['Port']}" - UIDesktop.UIOSelector_Get_UIO( - [ - {"process": lProcessId, "backend": "uia"}, - {"title": "Компьютер:"}, - {"title": "Компьютер:", "control_type": "Edit"}] - ).set_text(f"{lHostPort}") - #Set user - diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py index 549e7d43..02deb771 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py @@ -1,6 +1,22 @@ #Robot RDPActive settings def Settings(): mDict = { - + "RDPList": + [ + { + "Host": "77.77.22.22", # Host address + "Port": "7777", # RDP Port + "Login": "test", # Login + "Password": "test", # Password + "Screen": { + "Width": 1680, #Width of the remote desktop in pixels + "Height": 1050, #Height of the remote desktop in pixels + # "640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen + "FlagUseAllMonitors": False, # True or False + "DepthBit": "32" # "32" or "24" or "16" or "15" + }, + "SessionHex":"" # Hex is created when robot runs + } + ] } return mDict \ No newline at end of file diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Template.rdp b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Template.rdp new file mode 100644 index 00000000..10193862 Binary files /dev/null and b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/Template.rdp differ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/__main__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/__main__.py index 2e5729ef..a3d0fe99 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/__main__.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/RobotRDPActive/__main__.py @@ -1,20 +1,43 @@ +#Run example +#cd %~dp0..\..\Sources +#..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe -m pyOpenRPA.Tools.RobotRDPActive "C:\Abs\Archive\scopeSrcUL\Settings.py" +#pause >nul #Import parent folder to import current / other packages ######################################################### import sys +import subprocess #start process async +import os #path, run, remove +import time #timer +import importlib #lFolderPath = "\\".join(__file__.split("\\")[:-4]) lFolderPath = "/".join(__file__.split("/")[:-4]) sys.path.insert(0, lFolderPath) +#Единый глобальный словарь (За основу взять из Settings.py) +global mGlobalDict +#Call Settings function from argv[1] file +################################################ +lSubmoduleFunctionName = "Settings" +lFileFullPath = sys.argv[1] +lModuleName = (lFileFullPath.split("\\")[-1])[0:-3] +lTechSpecification = importlib.util.spec_from_file_location(lModuleName, lFileFullPath) +lTechModuleFromSpec = importlib.util.module_from_spec(lTechSpecification) +lTechSpecificationModuleLoader = lTechSpecification.loader.exec_module(lTechModuleFromSpec) +mGlobalDict = None +if lSubmoduleFunctionName in dir(lTechModuleFromSpec): + # Run SettingUpdate function in submodule + mGlobalDict = getattr(lTechModuleFromSpec, lSubmoduleFunctionName)() +################################################# ######################################################### -from pyOpenRPA.Tools.RobotRDPActive import RDPConnector -mConfiguration={ - "Host": "77.77.22.22", #Host address - "Port": "7777", #RDP Port - "Login": "test", # Login - "Password": "test", #Password - "Screen": { - "Resolution":"FullScreen", #"640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen - "FlagUseAllMonitors": False, # True or False - "DepthBit":"" #"32" or "24" or "16" or "15" - } -} -RDPConnector.SessionConnect(mConfiguration) \ No newline at end of file +from pyOpenRPA.Tools.RobotRDPActive import Connector +from pyOpenRPA.Tools.RobotRDPActive import Monitor +#Disable certificate warning +lCMDString = 'reg add "HKEY_CURRENT_USER\\Software\\Microsoft\\Terminal Server Client" /v "AuthenticationLevelOverride" /t "REG_DWORD" /d 0 /f' +os.system(lCMDString) +#time.sleep() +for lConfigurationItem in mGlobalDict["RDPList"]: + Connector.Session(lConfigurationItem) +#Run monitor +Monitor.Monitor(mGlobalDict, 1) +#Enable certificate warning +lCMDString = 'reg add "HKEY_CURRENT_USER\\Software\\Microsoft\\Terminal Server Client" /v "AuthenticationLevelOverride" /t "REG_DWORD" /d 2 /f' +os.system(lCMDString) \ No newline at end of file diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/__init__.py index 4cb9341d..a200a5bd 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/__init__.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/__init__.py @@ -3,7 +3,7 @@ r""" The OpenRPA package (from UnicodeLabs) """ -__version__ = 'v1.0.27' +__version__ = 'v1.0.28' __all__ = [] __author__ = 'Ivan Maslov ' #from .Core import Robot \ No newline at end of file diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Template.rdp b/Resources/WPy64-3720/python-3.7.2.amd64/Template.rdp new file mode 100644 index 00000000..10193862 Binary files /dev/null and b/Resources/WPy64-3720/python-3.7.2.amd64/Template.rdp differ diff --git a/Sources/pyOpenRPA.egg-info/PKG-INFO b/Sources/pyOpenRPA.egg-info/PKG-INFO index 584c6cad..e2812eaa 100644 --- a/Sources/pyOpenRPA.egg-info/PKG-INFO +++ b/Sources/pyOpenRPA.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyOpenRPA -Version: 1.0.27 +Version: 1.0.28 Summary: First open source RPA platform for business Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Author: Ivan Maslov diff --git a/Sources/pyOpenRPA.egg-info/SOURCES.txt b/Sources/pyOpenRPA.egg-info/SOURCES.txt index d76ce56d..0daf7cf1 100644 --- a/Sources/pyOpenRPA.egg-info/SOURCES.txt +++ b/Sources/pyOpenRPA.egg-info/SOURCES.txt @@ -207,7 +207,9 @@ pyOpenRPA/Studio/__main__.py pyOpenRPA/Studio/Web/Index.xhtml pyOpenRPA/Studio/Web/favicon.ico pyOpenRPA/Tools/__init__.py -pyOpenRPA/Tools/RobotRDPActive/RDPConnector.py +pyOpenRPA/Tools/RobotRDPActive/Connector.py +pyOpenRPA/Tools/RobotRDPActive/Monitor.py pyOpenRPA/Tools/RobotRDPActive/SettingsExample.py +pyOpenRPA/Tools/RobotRDPActive/Template.rdp pyOpenRPA/Tools/RobotRDPActive/__init__.py pyOpenRPA/Tools/RobotRDPActive/__main__.py \ No newline at end of file diff --git a/Sources/pyOpenRPA/__init__.py b/Sources/pyOpenRPA/__init__.py index 4cb9341d..a200a5bd 100644 --- a/Sources/pyOpenRPA/__init__.py +++ b/Sources/pyOpenRPA/__init__.py @@ -3,7 +3,7 @@ r""" The OpenRPA package (from UnicodeLabs) """ -__version__ = 'v1.0.27' +__version__ = 'v1.0.28' __all__ = [] __author__ = 'Ivan Maslov ' #from .Core import Robot \ No newline at end of file diff --git a/Sources/setup.py b/Sources/setup.py index ba087e4c..a5e5b97c 100644 --- a/Sources/setup.py +++ b/Sources/setup.py @@ -17,7 +17,8 @@ datafiles = datafiles + [(d, [os.path.join(d,f) for f in files]) datadir = "pyOpenRPA\\Studio\\Web" datafiles = datafiles + [(d, [os.path.join(d,f) for f in files]) for d, folders, files in os.walk(datadir)] - +datafile = "pyOpenRPA\\Tools\\RobotRDPActive\\Template.rdp" +datafiles = datafiles + [datafile] setup(name='pyOpenRPA', version=Version.Get(".."), description='First open source RPA platform for business',