dev-linux
Ivan Maslov 5 years ago
parent b5f67a67dd
commit f6a364518e

1
.gitignore vendored

@ -7,6 +7,7 @@
/**/Robot/**/Reports /**/Robot/**/Reports
/**/Sources/build /**/Sources/build
/**/Sources/dist /**/Sources/dist
/**/Sources/pyOpenRPA.egg-info
/**/Studio/**/Reports /**/Studio/**/Reports
/**/OpenRPA_Orchestrator.exe /**/OpenRPA_Orchestrator.exe
/**/OpenRPAOrchestrator.exe /**/OpenRPAOrchestrator.exe

@ -10,6 +10,13 @@ def SettingsUpdate(inDict):
"URL":"/", "URL":"/",
#"FlagAccessDefRequestGlobalAuthenticate": TestDef #"FlagAccessDefRequestGlobalAuthenticate": TestDef
"FlagAccess": True "FlagAccess": True
},
{
"Method":"POST",
"MatchType":"Beginwith",
"URL":"/",
#"FlagAccessDefRequestGlobalAuthenticate": TestDef
"FlagAccess": True
} }
] ]
} }

@ -0,0 +1,73 @@
import psutil
import datetime
import logging
def RenderRobotRDPActive(inGlobalConfiguration):
#Subheader Variants
lSubheaderRunTrueText="Состояние: <span style=\"color:green\">Turned on</span>"
lSubheaderRunFalseText="Состояние: <span style=\"color:red\">Turned off</span>"
#Run button
#Такое большое количество слэшей связано с тем, что этот текст отправляется сначала в браузер, рендерится там, а потом отправляется на процессор оркестратора
import os
lRobotRDPActivePath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..\\..\\Utils\\RobotRDPActive\\pyOpenRPA.Tools.RobotRDPActive_x64.cmd")
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 OpenRPA_RobotRDPActive.exe');"
#Result template
lResultDict={
"HeaderLeftText":"Keep active RDP sessions",
"HeaderRightText":"Tech",
"DataStorageKey":"RobotRDPActive", #Use key for set current dict in mGlobal.DataStorage["DtaaStorageKey"] on client side
"SubheaderText":lSubheaderRunFalseText,
"BodyKeyValueList":[
{"Key":"Session list","Value":""}
],
"FooterText":"Дата изменения: 9:38:00 09.10.2019",
"FooterButtonX2List":[
{"Text":"Turn on", "Color":"green", "Link":"", "OnClick": lOnClickRunButton.replace("\\","\\\\")},
{"Text":"Safe turn off", "Color":"orange", "Link":"", "OnClick": lOnClickSafeTurnOff.replace("\\","\\\\")}
],
"FooterButtonX1List":[
{"Text":"Kill", "Color":"red", "Link":"", "OnClick": lOnClickForceCloseButton.replace("\\","\\\\")}
],
"Data":inGlobalConfiguration["Storage"]
}
#Read RDPList
lRDPList = inGlobalConfiguration.get("Storage",{}).get("RobotRDPActive",{}).get("RobotToOrchestratorStorage",{}).get("RDPList",[])
lRDPListIndex = 0
for lItem in lRDPList:
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}"})
lRDPListIndex = lRDPListIndex + 1
#Check if process running
if CheckIfProcessRunning("OpenRPA_RobotRDPActive"):
lResultDict["SubheaderText"]=lSubheaderRunTrueText
#Process not running
lResultDict["FooterText"]=f'Дата обновления: {datetime.datetime.now().strftime("%H:%M:%S %d.%m.%Y")}'
return lResultDict
def CheckIfProcessRunning(processName):
'''
Check if there is any running process that contains the given name processName.
'''
#Iterate over the all the running process
for proc in psutil.process_iter():
try:
# Check if process name contains the given name string.
if processName.lower() in proc.name().lower():
return True
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
pass
return False;
#Orchestrator settings
def SettingsUpdate(inDict):
#Add RobotRDPActive in control panel
inDict["ControlPanelDict"]["RobotList"].append({"RenderFunction": RenderRobotRDPActive})
#Default structure
inDict["Storage"]["RobotRDPActive"]={"OrchestratorToRobotResetStorage":{"SafeTurnOff":False}}
return inDict

@ -38,6 +38,8 @@ def Settings():
} }
] ]
} }
#Turn off many warnings from orchestrator connector logger
OrchestratorConnector.LoggerSetLevelError()
#Run OrchestratorConnector initialization #Run OrchestratorConnector initialization
OrchestratorConnector.ConfigurationInit(mDict["OrchestratorConnector"]) OrchestratorConnector.ConfigurationInit(mDict["OrchestratorConnector"])
######################### #########################
@ -57,3 +59,4 @@ def Settings():
# add handler to logger object # add handler to logger object
mRobotLogger.addHandler(mRobotLoggerFH) mRobotLogger.addHandler(mRobotLoggerFH)
############################################ ############################################
return mDict

@ -1,72 +0,0 @@
Metadata-Version: 2.1
Name: pyOpenRPA
Version: 1.0.32
Summary: First open source RPA platform for business
Home-page: https://gitlab.com/UnicodeLabs/OpenRPA
Author: Ivan Maslov
Author-email: Ivan.Maslov@unicodelabs.ru
License: MIT
Description: # OpenRPA
First open source RPA platform for business is released!
# How to run
Studio
Double click to Studio\StudioRun_32.cmd or Studio\StudioRun_64.cmd
# Robot how to debug
Robot\PythonDebug_64.cmd
import Robot
Robot.ActivityRun(
{
ModuleName: <"GUI"|..., str>,
ActivityName: <Function or procedure name in module, str>,
ArgumentList: [<Argument 1, any type>, ...] - optional,
ArgumentDict: {<Argument 1 name, str>:<Argument 1 value, any type>, ...} - optional
}
)
# Robot example script:
Robot\Examples\GetFolderList\Python_32_Script_Run.cmd
# Python 32 bit
Resources\WPy32-3720\python-3.7.2\python.exe
# Python 64 bit
Resources\WPy64-3720\python-3.7.2.amd64\python.exe
# Module GUI activity List:
############################
Новая версия
############################
Получить список элементов, который удовлетворяет условиям через расширенный движок поиска
[
{
"index":<Позиция элемента в родительском объекте>,
"depth_start" - глубина, с которой начинается поиск (по умолчанию 1)
"depth_end" - глубина, до которой ведется поиск (по умолчанию 1)
"class_name" - наименование класса, который требуется искать
"title" - наименование заголовка
"rich_text" - наименование rich_text
}
]
# Open RPA Wiki
- [Home](https://gitlab.com/UnicodeLabs/OpenRPA/wikis/home)
- [04. Desktop app access (win32 & ui automation)](https://gitlab.com/UnicodeLabs/OpenRPA/wikis/04.-Desktop-app-access-(win32-&-ui-automation))
#Dependencies
* Python 3 x32 [psutil, pywinauto, wmi, PIL, keyboard, pyautogui, win32api (pywin32), selenium, openCV, tesseract, requests, lxml, PyMuPDF]
* Python 3 x64 [psutil, pywinauto, wmi, PIL, keyboard, pyautogui, win32api (pywin32), selenium, openCV, tesseract, requests, lxml, PyMuPDF]
* pywinauto (Windows GUI automation)
* Semantic UI CSS framework
* JsRender by https://www.jsviews.com (switch to Handlebars)
* Handlebars
Created by Unicode Labs (Ivan Maslov)
Keywords: OpenRPA RPA Robot Automation Robotization
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown

@ -1,221 +0,0 @@
setup.py
pyOpenRPA/__init__.py
pyOpenRPA.egg-info/PKG-INFO
pyOpenRPA.egg-info/SOURCES.txt
pyOpenRPA.egg-info/dependency_links.txt
pyOpenRPA.egg-info/not-zip-safe
pyOpenRPA.egg-info/requires.txt
pyOpenRPA.egg-info/top_level.txt
pyOpenRPA/Orchestrator/Orchestrator.py
pyOpenRPA/Orchestrator/Processor.py
pyOpenRPA/Orchestrator/Server.py
pyOpenRPA/Orchestrator/ServerSettings.py
pyOpenRPA/Orchestrator/Timer.py
pyOpenRPA/Orchestrator/__init__.py
pyOpenRPA/Orchestrator/__main__.py
pyOpenRPA/Orchestrator/Web/Index.xhtml
pyOpenRPA/Orchestrator/Web/favicon.ico
pyOpenRPA/Resources/Web/Google/LatoItalic.css
pyOpenRPA/Resources/Web/Handlebars/handlebars-v4.1.2.js
pyOpenRPA/Resources/Web/JsRender/jsrender.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/.versions
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/LICENSE
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/README.md
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/package.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/package.json
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/semantic.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/semantic.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/semantic.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/semantic.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/accordion.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/accordion.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/accordion.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/accordion.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/ad.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/ad.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/api.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/api.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/breadcrumb.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/breadcrumb.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/button.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/button.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/card.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/card.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/checkbox.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/checkbox.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/checkbox.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/checkbox.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/colorize.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/colorize.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/comment.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/comment.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/container.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/container.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/dimmer.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/dimmer.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/dimmer.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/dimmer.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/divider.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/divider.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/dropdown.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/dropdown.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/dropdown.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/dropdown.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/embed.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/embed.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/embed.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/embed.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/feed.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/feed.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/flag.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/flag.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/form.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/form.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/form.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/form.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/grid.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/grid.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/header.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/header.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/icon.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/icon.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/image.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/image.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/input.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/input.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/item.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/item.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/label.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/label.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/list.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/list.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/loader.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/loader.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/menu.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/menu.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/message.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/message.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/modal.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/modal.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/modal.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/modal.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/nag.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/nag.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/nag.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/nag.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/placeholder.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/placeholder.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/popup.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/popup.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/popup.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/popup.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/progress.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/progress.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/progress.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/progress.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/rail.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/rail.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/rating.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/rating.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/rating.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/rating.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/reset.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/reset.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/reveal.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/reveal.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/search.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/search.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/search.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/search.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/segment.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/segment.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/shape.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/shape.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/shape.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/shape.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/sidebar.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/sidebar.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/sidebar.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/sidebar.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/site.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/site.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/site.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/site.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/state.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/state.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/statistic.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/statistic.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/step.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/step.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/sticky.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/sticky.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/sticky.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/sticky.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/tab.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/tab.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/tab.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/tab.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/table.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/table.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/transition.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/transition.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/transition.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/transition.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/video.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/video.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/video.min.css
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/video.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/visibility.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/visibility.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/visit.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/components/visit.min.js
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/brand-icons.eot
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/brand-icons.svg
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/brand-icons.ttf
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/brand-icons.woff
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/brand-icons.woff2
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/icons.eot
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/icons.otf
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/icons.svg
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/icons.ttf
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/icons.woff
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/icons.woff2
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/outline-icons.eot
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/outline-icons.svg
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/outline-icons.ttf
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/outline-icons.woff
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/fonts/outline-icons.woff2
pyOpenRPA/Resources/Web/Semantic-UI-CSS-master/themes/default/assets/images/flags.png
pyOpenRPA/Resources/Web/jQuery/jquery-3.1.1.min.js
pyOpenRPA/Robot/Clipboard.py
pyOpenRPA/Robot/IntegrationOrchestrator.py
pyOpenRPA/Robot/JSONNormalize.py
pyOpenRPA/Robot/ProcessCommunicator.py
pyOpenRPA/Robot/Robot.py
pyOpenRPA/Robot/UIDesktop.py
pyOpenRPA/Robot/ValueVerify.py
pyOpenRPA/Robot/Window.py
pyOpenRPA/Robot/__init__.py
pyOpenRPA/Robot/__main__.py
pyOpenRPA/Robot/Utils/ProcessBitness.py
pyOpenRPA/Robot/Utils/__init__.py
pyOpenRPA/Studio/JSONNormalize.py
pyOpenRPA/Studio/ProcessCommunicator.py
pyOpenRPA/Studio/Studio.py
pyOpenRPA/Studio/ValueVerify.py
pyOpenRPA/Studio/__init__.py
pyOpenRPA/Studio/__main__.py
pyOpenRPA/Studio/Web/Index.xhtml
pyOpenRPA/Studio/Web/favicon.ico
pyOpenRPA/Tools/__init__.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
pyOpenRPA/Tools/RobotScreenActive/ConsoleStart.bat
pyOpenRPA/Tools/RobotScreenActive/Monitor.py
pyOpenRPA/Tools/RobotScreenActive/Screen.py
pyOpenRPA/Tools/RobotScreenActive/__init__.py
pyOpenRPA/Tools/RobotScreenActive/__main__.py

@ -1,6 +0,0 @@
pywinauto>=0.6.6
WMI>=1.4.9
pillow>=6.0.0
keyboard>=0.13.3
pyautogui>=0.9.44
pywin32>=224

@ -275,8 +275,8 @@
}); });
} }
/// ///
mGlobal.Monitor.mControlPanelAutoUpdateSeconds=5; mGlobal.Monitor.mControlPanelAutoUpdateSeconds=3;
mGlobal.Monitor.mControlPanelAutoUpdateSecondsCurrent=5; mGlobal.Monitor.mControlPanelAutoUpdateSecondsCurrent=3;
mGlobal.Monitor.fControlPanelAutoUpdateRun=function(inRefreshSeconds) { mGlobal.Monitor.fControlPanelAutoUpdateRun=function(inRefreshSeconds) {
mGlobal.Monitor.mControlPanelAutoUpdateSeconds=inRefreshSeconds; mGlobal.Monitor.mControlPanelAutoUpdateSeconds=inRefreshSeconds;
//Функция обновления текста кнопки обновления //Функция обновления текста кнопки обновления
@ -291,7 +291,7 @@
mGlobal.Monitor.mControlPanelAutoUpdateTimerId=setInterval(lControlPanelUpdate,1000) mGlobal.Monitor.mControlPanelAutoUpdateTimerId=setInterval(lControlPanelUpdate,1000)
} }
mGlobal.Monitor.fControlPanelRefresh() mGlobal.Monitor.fControlPanelRefresh()
mGlobal.Monitor.fControlPanelAutoUpdateRun(5); mGlobal.Monitor.fControlPanelAutoUpdateRun(3);
mGlobal.Test=function() { mGlobal.Test=function() {
///Обнулить таблицу ///Обнулить таблицу
@ -355,6 +355,29 @@
/////////////////////////////// ///////////////////////////////
mGlobal.Processor = {} mGlobal.Processor = {}
mGlobal.Processor.ServerValueSet = function(inKeyList,inValue) {
lData = [
{
"Type":"GlobalDictKeyListValueSet",
"KeyList": inKeyList,
"Value": inValue
}
]
///Обнулить таблицу
$('.ui.modal.basic .content').html("");
$.ajax({
type: "POST",
url: 'Utils/Processor',
data: JSON.stringify(lData),
success:
function(lData,l2,l3)
{
var lResponseJSON=JSON.parse(lData)
///TODO Show error if exist error
},
dataType: "text"
});
}
mGlobal.Processor.LogListShow = function() { mGlobal.Processor.LogListShow = function() {
lData = [ lData = [
{ {
@ -633,7 +656,7 @@
<div class="ui basic {{Color}} button" onclick="{{OnClick}}">{{{Text}}}</div> <div class="ui basic {{Color}} button" onclick="{{OnClick}}">{{{Text}}}</div>
{{/FooterButtonX2List}} {{/FooterButtonX2List}}
</div> </div>
<div class="ui horizontal divider">Доп. управление</div> <div class="ui horizontal divider">Add. controls</div>
<div class="ui one buttons"> <div class="ui one buttons">
{{#FooterButtonX1List}} {{#FooterButtonX1List}}
<div class="ui basic {{Color}} button" onclick="{{OnClick}}">{{{Text}}}</div> <div class="ui basic {{Color}} button" onclick="{{OnClick}}">{{{Text}}}</div>

@ -7,6 +7,11 @@ import copy
from .Utils import TimerRepeat # Timer which can repeating from .Utils import TimerRepeat # Timer which can repeating
mLogger=logging.getLogger("OrchestratorConnector") mLogger=logging.getLogger("OrchestratorConnector")
######################### #########################
mTimerList=[]
def IntervalTerminateAll():
for lItem in mTimerList:
lItem.stop()
#########################
# Создать файл логирования # Создать файл логирования
# add filemode="w" to overwrite # add filemode="w" to overwrite
if not os.path.exists("Reports"): if not os.path.exists("Reports"):
@ -22,6 +27,9 @@ mLoggerFH.setFormatter(mLoggerFormatter)
# add handler to logger object # add handler to logger object
mLogger.addHandler(mLoggerFH) mLogger.addHandler(mLoggerFH)
############################################ ############################################
#Turn loggin level ERROR
def LoggerSetLevelError():
mLogger.setLevel(logging.ERROR)
#from requests import async #from requests import async
import json import json
################################### ###################################
@ -120,6 +128,8 @@ def IntervalDataReceiveAsync(*args, **kwargs):
del lKwargs["Interval"] del lKwargs["Interval"]
lTimer = TimerRepeat.TimerRepeat(lInterval, DataReceiveAsync, lArgs, lKwargs) lTimer = TimerRepeat.TimerRepeat(lInterval, DataReceiveAsync, lArgs, lKwargs)
lTimer.start() lTimer.start()
#Add timer to general list to stop this when needed
mTimerList.append(lTimer)
return lTimer return lTimer
################################################################################ ################################################################################
################################### ###################################
@ -216,6 +226,8 @@ def IntervalDataSendAsync(*args,**kwargs):
del lKwargs["Interval"] del lKwargs["Interval"]
lTimer = TimerRepeat.TimerRepeat(lInterval, DataSendAsync, lArgs, lKwargs) lTimer = TimerRepeat.TimerRepeat(lInterval, DataSendAsync, lArgs, lKwargs)
lTimer.start() lTimer.start()
#Add timer to general list to stop this when needed
mTimerList.append(lTimer)
return lTimer return lTimer
################################################################################ ################################################################################
################################### ###################################
@ -297,6 +309,8 @@ def IntervalDataSendResetAsync(*args,**kwargs):
del lKwargs["Interval"] del lKwargs["Interval"]
lTimer = TimerRepeat.TimerRepeat(lInterval, DataSendResetAsync, lArgs, lKwargs) lTimer = TimerRepeat.TimerRepeat(lInterval, DataSendResetAsync, lArgs, lKwargs)
lTimer.start() lTimer.start()
#Add timer to general list to stop this when needed
mTimerList.append(lTimer)
return lTimer return lTimer
################################################################################ ################################################################################
# Check changes in orchestrator - then replace in RobotStorage if not equeal. Has no timeout because You can use function IntervalDataReceiveResetAsync (asynchronyous) # Check changes in orchestrator - then replace in RobotStorage if not equeal. Has no timeout because You can use function IntervalDataReceiveResetAsync (asynchronyous)
@ -371,6 +385,8 @@ def IntervalDataReceiveResetAsync(*args,**kwargs):
del lKwargs["Interval"] del lKwargs["Interval"]
lTimer = TimerRepeat.TimerRepeat(lInterval, DataReceiveResetAsync, lArgs, lKwargs) lTimer = TimerRepeat.TimerRepeat(lInterval, DataReceiveResetAsync, lArgs, lKwargs)
lTimer.start() lTimer.start()
#Add timer to general list to stop this when needed
mTimerList.append(lTimer)
return lTimer return lTimer
################################################################################# #################################################################################
################################################################################# #################################################################################

@ -148,6 +148,6 @@ def run():
# Logging # Logging
mGlobalDict["Logger"].info(f"Server init. Listen URL: {inServerAddress}, Listen port: {inPort}") mGlobalDict["Logger"].info(f"Server init. Listen URL: {inServerAddress}, Listen port: {inPort}")
# Запуск адреса в браузере # Запуск адреса в браузере
os.system("explorer http://127.0.0.1:8081") os.system(f"explorer http://127.0.0.1:{str(inPort)}")
httpd.serve_forever() httpd.serve_forever()
run() run()

@ -84,7 +84,7 @@ def SessionRDPStart(inRDPFilePath):
[{"title_re": f"{lRDPFileName} — .*", [{"title_re": f"{lRDPFileName} — .*",
"class_name": "TscShellContainerClass", "backend": "win32"}] "class_name": "TscShellContainerClass", "backend": "win32"}]
], ],
60 30
) )
#Click if 0 is appear (RUS) #Click if 0 is appear (RUS)
if 0 in lWaitResult: if 0 in lWaitResult:
@ -99,7 +99,7 @@ def SessionRDPStart(inRDPFilePath):
[{"title_re": f"{lRDPFileName} — .*", [{"title_re": f"{lRDPFileName} — .*",
"class_name": "TscShellContainerClass", "backend": "win32"}] "class_name": "TscShellContainerClass", "backend": "win32"}]
], ],
60 30
) )
# Click if 1 is appear (ENG) # Click if 1 is appear (ENG)
if 1 in lWaitResult: if 1 in lWaitResult:
@ -115,7 +115,7 @@ def SessionRDPStart(inRDPFilePath):
[{"title_re": f"{lRDPFileName} — .*", [{"title_re": f"{lRDPFileName} — .*",
"class_name": "TscShellContainerClass", "backend": "win32"}] "class_name": "TscShellContainerClass", "backend": "win32"}]
], ],
60 30
) )
#Prepare little window #Prepare little window
SessionScreen100x550(lRDPFileName) SessionScreen100x550(lRDPFileName)

@ -1,17 +1,34 @@
from pyOpenRPA.Robot import UIDesktop from pyOpenRPA.Robot import UIDesktop
from . import Connector from . import Connector
import os
import pdb import pdb
#Check for session is closed. Reopen if detected. Always keep session is active #Check for session is closed. Reopen if detected. Always keep session is active
def Monitor(inGlobalDict, inListUpdateTimeout): def Monitor(inGlobalDict, inListUpdateTimeout):
while True: lFlagWhile = True
while lFlagWhile:
# UIOSelector list init # UIOSelector list init
lUIOSelectorList = [] lUIOSelectorList = []
for lItem in inGlobalDict["RDPList"]: 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 #Run wait command
lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout) lRDPDissappearList = UIDesktop.UIOSelectorsSecs_WaitDisappear_List(lUIOSelectorList, inListUpdateTimeout)
#Analyze if flag safeturn off is activated
if inGlobalDict.get("OrchestratorToRobotResetStorage",{}).get("SafeTurnOff",False):
lFlagWhile=False
#Set status disconnected for all RDP List
for lItem in inGlobalDict["RDPList"]:
lItem["FlagSessionIsActive"]=False
#Kill all RDP sessions
os.system('taskkill /F /im mstsc.exe')
#Return from function
return
for lItem in lRDPDissappearList: for lItem in lRDPDissappearList:
inGlobalDict["RDPList"][lItem]["FlagSessionIsActive"] = False # Set flag that session is disconnected
#pdb.set_trace() #pdb.set_trace()
#Session start #Session start
try:
Connector.Session(inGlobalDict["RDPList"][lItem]) Connector.Session(inGlobalDict["RDPList"][lItem])
except Exception:
pass
return None return None
#TODO Def garbage window cleaner (if connection was lost)

@ -1,22 +0,0 @@
#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

@ -35,9 +35,15 @@ lCMDString = 'reg add "HKEY_CURRENT_USER\\Software\\Microsoft\\Terminal Server C
os.system(lCMDString) os.system(lCMDString)
#time.sleep() #time.sleep()
for lConfigurationItem in mGlobalDict["RDPList"]: for lConfigurationItem in mGlobalDict["RDPList"]:
try:
Connector.Session(lConfigurationItem) Connector.Session(lConfigurationItem)
lConfigurationItem["FlagSessionIsActive"]=True #Flag that session is started
except Exception:
pass
#Run monitor #Run monitor
Monitor.Monitor(mGlobalDict, 1) Monitor.Monitor(mGlobalDict, 1)
#Enable certificate warning #Enable certificate warning
lCMDString = 'reg add "HKEY_CURRENT_USER\\Software\\Microsoft\\Terminal Server Client" /v "AuthenticationLevelOverride" /t "REG_DWORD" /d 2 /f' lCMDString = 'reg add "HKEY_CURRENT_USER\\Software\\Microsoft\\Terminal Server Client" /v "AuthenticationLevelOverride" /t "REG_DWORD" /d 2 /f'
os.system(lCMDString) os.system(lCMDString)
#Close all thread from OrchestratorConnection
mGlobalDict["OrchestratorConnectorTerminateAll"]()

@ -1,4 +1,13 @@
#Robot RDPActive settings #Robot RDPActive settings
from pyOpenRPA.Robot import OrchestratorConnector
import os
import logging
import datetime
#Definitions
lOrchestratorHost="localhost"
lOrchestratorPort=8081
lOrchestratorProtocol="http"
lOrchestratorAuthToken="1992-04-03-0643-ru-b4ff-openrpa52zzz"
def Settings(): def Settings():
mDict = { mDict = {
"RDPList": "RDPList":
@ -15,8 +24,83 @@ def Settings():
"FlagUseAllMonitors": False, # True or False "FlagUseAllMonitors": False, # True or False
"DepthBit": "32" # "32" or "24" or "16" or "15" "DepthBit": "32" # "32" or "24" or "16" or "15"
}, },
"SessionHex":"" # Hex is created when robot runs "SessionHex":"", # Hex is created when robot runs
"FlagSessionIsActive": False
}
],
"Logger": logging.getLogger("RobotRDPActive"),
"OrchestratorToRobotStorage": {
},
"OrchestratorToRobotResetStorage": {
"SafeTurnOff":False #Control from orchestrator to safety turn off robot
},
"OrchestratorConnector": {
#Fill below
},
"OrchestratorConnectorTerminateAll":OrchestratorConnector.IntervalTermimateAll
}
######################
#OrchestratorConnector
######################
mDict["OrchestratorConnector"]={
"IntervalDataSendAsync": [
{
"Interval": 2.7,
"RobotStorage": mDict,
"RobotStorageKey": "RDPList",
"OrchestratorKeyList": ["Storage", "RobotRDPActive","RobotToOrchestratorStorage","RDPList"],
"OrchestratorProtocol": lOrchestratorProtocol,
"OrchestratorHost": lOrchestratorHost,
"OrchestratorPort": lOrchestratorPort,
"OrchestratorAuthToken": lOrchestratorAuthToken
}
],
"IntervalDataReceiveResetAsync": [
{
"Interval": 3.3,
"RobotStorage": mDict,
"RobotStorageKey": "OrchestratorToRobotResetStorage",
"RobotResetValue": {"SafeTurnOff":False},
"OrchestratorKeyList": ["Storage", "RobotRDPActive","OrchestratorToRobotResetStorage"],
"OrchestratorProtocol": lOrchestratorProtocol,
"OrchestratorHost": lOrchestratorHost,
"OrchestratorPort": lOrchestratorPort,
"OrchestratorAuthToken": lOrchestratorAuthToken
}
],
"IntervalDataReceiveAsync": [
{
"Interval": 3.6,
"RobotStorage": mDict,
"RobotStorageKey": "OrchestratorToRobotStorage",
"OrchestratorKeyList": ["Storage", "RobotRDPActive","OrchestratorToRobotStorage"],
"OrchestratorProtocol": lOrchestratorProtocol,
"OrchestratorHost": lOrchestratorHost,
"OrchestratorPort": lOrchestratorPort,
"OrchestratorAuthToken": lOrchestratorAuthToken
} }
] ]
} }
#Turn off many warnings from orchestrator connector logger
OrchestratorConnector.LoggerSetLevelError()
#Run OrchestratorConnector initialization
OrchestratorConnector.ConfigurationInit(mDict["OrchestratorConnector"])
#########################
#Создать файл логирования
# add filemode="w" to overwrite
if not os.path.exists("Reports"):
os.makedirs("Reports")
##########################
#Подготовка логгера Robot
#########################
mRobotLogger=mDict["Logger"]
mRobotLogger.setLevel(logging.INFO)
# create the logging file handler
mRobotLoggerFH = logging.FileHandler("Reports\ReportRobotRDPActive_"+datetime.datetime.now().strftime("%Y_%m_%d")+".log")
mRobotLoggerFormatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
mRobotLoggerFH.setFormatter(mRobotLoggerFormatter)
# add handler to logger object
mRobotLogger.addHandler(mRobotLoggerFH)
############################################
return mDict return mDict

@ -1,3 +1,4 @@
cd %~dp0..\..\Sources cd %~dp0..\..\Sources
..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe -m pyOpenRPA.Tools.RobotRDPActive "C:\Abs\Archive\scopeSrcUL\OpenRPA_Creds\RobotRDPActive\SettingsVSK.py" copy /Y ..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe ..\Resources\WPy64-3720\python-3.7.2.amd64\OpenRPA_RobotRDPActive.exe
..\Resources\WPy64-3720\python-3.7.2.amd64\OpenRPA_RobotRDPActive.exe -m pyOpenRPA.Tools.RobotRDPActive "C:\Abs\Archive\scopeSrcUL\OpenRPA_Creds\RobotRDPActive\SettingsVSK.py"
pause >nul pause >nul
Loading…
Cancel
Save