|
|
|
import psutil, datetime, logging, os, sys # stdout from logging
|
|
|
|
|
|
|
|
# Config settings
|
|
|
|
lPyOpenRPASourceFolderPathStr = r"..\Sources" # Path for test pyOpenRPA package
|
|
|
|
|
|
|
|
# INFO Relative/Absolute import see below - after settings init
|
|
|
|
|
|
|
|
# Template for import CP - Control Panels
|
|
|
|
# ATTENTION - Pay attention to CP names! Orchestrator is one for the all control panels per one machine
|
|
|
|
|
|
|
|
## !!! For Absolute import !!!
|
|
|
|
# sys.path.insert(0,os.path.abspath(os.path.join(r"..\ROBOT\Builds")))
|
|
|
|
# import pyRobot_CP
|
|
|
|
# pyRobot_CP.SettingsUpdate(inGSettings=gSettings)
|
|
|
|
|
|
|
|
## !!! For Relative import !!!
|
|
|
|
# sys.path.insert(0,os.path.abspath(os.path.join(r"..\ROBOT\Builds")))
|
|
|
|
# from pyRobot_CP import ControlPanel
|
|
|
|
# ControlPanel.SettingsUpdate(inGSettings=gSettings)
|
|
|
|
|
|
|
|
# Operations
|
|
|
|
if lPyOpenRPASourceFolderPathStr != "": sys.path.insert(0,os.path.abspath(os.path.join(lPyOpenRPASourceFolderPathStr))) # Path for test pyOpenRPA package
|
|
|
|
# Start import after config the pyOpenRPA folder
|
|
|
|
from pyOpenRPA.Orchestrator import SettingsTemplate # Import functionallity
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": # New init way - allow run as module -m PyOpenRPA.Orchestrator
|
- Orc new structure for CP: "CPDict": { # "CPKey": {"HTMLRenderDef":None, "JSONGeneratorDef":None, "JSInitGeneratorDef":None}},
- - Back: inGSettings["CPDict"][RobotKeyStr]["HTMLRenderDef"] > Front: mGlobal.pyOpenRPA.ServerDataDict.CPDict.RobotKeyStr.HTMLStr
- - Back: inGSettings["CPDict"][RobotKeyStr]["JSONGeneratorDef"] > Front: mGlobal.pyOpenRPA.ServerDataDict.CPDict.RobotKeyStr.JSONDict
- - CPDict > HTMLRenderDef > def (inGSettings); def (inRequest, inGSettings); def ()
- - CPDict > JSONGeneratorDef > def (inGSettings); def (inRequest, inGSettings); def ()
- - CPDict > JSInitGeneratorDef > def (inGSettings); def (inRequest, inGSettings); def ()
Orc connect JSONGenerators to WEB Front (mGlobal.)
- Orc back: add new block: OrchestratorWeb
- - def OrchestratorWebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None): # Add control panel HTML, JSON generator or JS when page init
4 years ago
|
|
|
from pyOpenRPA import Orchestrator # Import orchestrator main
|
|
|
|
gSettings = SettingsTemplate.Create(inModeStr="BASIC") # Create GSettings with basic configuration
|
|
|
|
|
|
|
|
# TEST Add User ND - Add Login ND to superuser of the Orchestrator
|
|
|
|
lUACClientDict = SettingsTemplate.__UACClientAdminCreate__()
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["LogViewerBool"]
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["CMDInputBool"]
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["ScreenshotViewerBool"]
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartOrchestratorBool"]
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartOrchestratorGITPullBool"]
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartPCBool"]
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["RDPKeyDict"]
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["AgentKeyDict"]
|
|
|
|
# del lUACClientDict["pyOpenRPADict"]["CPKeyDict"]
|
|
|
|
#lUACClientDict["pyOpenRPADict"]["CPKeyDict"]["VersionCheck"]=True
|
|
|
|
#lUACClientDict["pyOpenRPADict"]["CPKeyDict"]["TEST"]=True
|
- Orc new structure for CP: "CPDict": { # "CPKey": {"HTMLRenderDef":None, "JSONGeneratorDef":None, "JSInitGeneratorDef":None}},
- - Back: inGSettings["CPDict"][RobotKeyStr]["HTMLRenderDef"] > Front: mGlobal.pyOpenRPA.ServerDataDict.CPDict.RobotKeyStr.HTMLStr
- - Back: inGSettings["CPDict"][RobotKeyStr]["JSONGeneratorDef"] > Front: mGlobal.pyOpenRPA.ServerDataDict.CPDict.RobotKeyStr.JSONDict
- - CPDict > HTMLRenderDef > def (inGSettings); def (inRequest, inGSettings); def ()
- - CPDict > JSONGeneratorDef > def (inGSettings); def (inRequest, inGSettings); def ()
- - CPDict > JSInitGeneratorDef > def (inGSettings); def (inRequest, inGSettings); def ()
Orc connect JSONGenerators to WEB Front (mGlobal.)
- Orc back: add new block: OrchestratorWeb
- - def OrchestratorWebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None): # Add control panel HTML, JSON generator or JS when page init
4 years ago
|
|
|
#lUACClientDict["pyOpenRPADict"]["AgentKeyDict"]["DESKTOP----;ND"]=True
|
- def UACKeyListCheck(inRequest, inRoleKeyList): #Check is client is has access for the key list
- def WebUserInfoGet(inRequest): # Return User info about request Return {"DomainUpperStr":"", "UserNameUpperStr": ""}
- def WebUserUACHierarchyGet(inRequest): # Return User UAC Hierarchy DICT Return {...}
- Scheduler
- Refactoring in gSettings (Scheduler > SchedulerDict)
- def SchedulerActivityTimeAddWeekly(inGSettings, inTimeHHMMStr="23:55:", inWeekdayList=[], inActivityList=[]): # Add activity in time weekly
- Scheduler now listen SchedulerDict
- def ProcessorActivityItemAppend(inGSettings, inDef, inArgList=[], inArgDict={}, inArgGSettingsStr=None, inArgLoggerStr=None): # Add Activity item in Processor list
4 years ago
|
|
|
Orchestrator.UACUpdate(inGSettings=gSettings, inADLoginStr="ND", inADStr="", inADIsDefaultBool=True, inURLList=[], inRoleHierarchyAllowedDict=lUACClientDict)
|
|
|
|
# TEST Add User IMaslov - Add Login IMaslov to superuser of the Orchestrator
|
- def UACKeyListCheck(inRequest, inRoleKeyList): #Check is client is has access for the key list
- def WebUserInfoGet(inRequest): # Return User info about request Return {"DomainUpperStr":"", "UserNameUpperStr": ""}
- def WebUserUACHierarchyGet(inRequest): # Return User UAC Hierarchy DICT Return {...}
- Scheduler
- Refactoring in gSettings (Scheduler > SchedulerDict)
- def SchedulerActivityTimeAddWeekly(inGSettings, inTimeHHMMStr="23:55:", inWeekdayList=[], inActivityList=[]): # Add activity in time weekly
- Scheduler now listen SchedulerDict
- def ProcessorActivityItemAppend(inGSettings, inDef, inArgList=[], inArgDict={}, inArgGSettingsStr=None, inArgLoggerStr=None): # Add Activity item in Processor list
4 years ago
|
|
|
Orchestrator.UACUpdate(inGSettings=gSettings, inADLoginStr="IMaslov", inADStr="", inADIsDefaultBool=True, inURLList=[])
|
|
|
|
# TEST Add Supertoken for the all access between robots
|
- def UACKeyListCheck(inRequest, inRoleKeyList): #Check is client is has access for the key list
- def WebUserInfoGet(inRequest): # Return User info about request Return {"DomainUpperStr":"", "UserNameUpperStr": ""}
- def WebUserUACHierarchyGet(inRequest): # Return User UAC Hierarchy DICT Return {...}
- Scheduler
- Refactoring in gSettings (Scheduler > SchedulerDict)
- def SchedulerActivityTimeAddWeekly(inGSettings, inTimeHHMMStr="23:55:", inWeekdayList=[], inActivityList=[]): # Add activity in time weekly
- Scheduler now listen SchedulerDict
- def ProcessorActivityItemAppend(inGSettings, inDef, inArgList=[], inArgDict={}, inArgGSettingsStr=None, inArgLoggerStr=None): # Add Activity item in Processor list
4 years ago
|
|
|
Orchestrator.UACSuperTokenUpdate(inGSettings=gSettings, inSuperTokenStr="1992-04-03-0643-ru-b4ff-openrpa52zzz")
|
|
|
|
|
|
|
|
## !!! For Relative import !!! CP Version Check
|
|
|
|
try:
|
|
|
|
sys.path.insert(0,os.path.abspath(os.path.join(r"")))
|
|
|
|
from ControlPanel import CP_VersionCheck
|
|
|
|
CP_VersionCheck.SettingsUpdate(inGSettings=gSettings)
|
|
|
|
except Exception as e:
|
|
|
|
gSettings["Logger"].exception(f"Exception when init CP. See below.")
|
|
|
|
|
|
|
|
try:
|
|
|
|
from ControlPanel import CP_Test
|
|
|
|
CP_Test.SettingsUpdate(inGSettings=gSettings)
|
|
|
|
except Exception as e:
|
|
|
|
gSettings["Logger"].exception(f"Exception when init CP. See below.")
|
|
|
|
|
|
|
|
# Call the orchestrator def
|
|
|
|
Orchestrator.Orchestrator(inGSettings=gSettings)
|
|
|
|
|
|
|
|
else:
|
|
|
|
print("!WARNING! Current orchestrator settings do not support old type of the Orchestrator start. Use new Orchestrator type start (see v1.2.0)")
|
|
|
|
|