2. Defs

pyOpenRPA.Orchestrator.__Orchestrator__

# EXAMPLE 1
from pyOpenRPA import Orchestrator
Orchestrator.OSCMD(inCMDStr = "git status", inRunAsyncBool=True)

# EXAMPLE 2
from pyOpenRPA.Orchestrator import __Orchestrator__
__Orchestrator__.OSCMD(inCMDStr = "git status", inRunAsyncBool=True)

Group Agent…

Interaction between Orchestrator and pyOpenRPA.Agent daemon process, which can be deployed in another user session.

Group GSettings…

Basic defs to work with singleton gSettings.

Group Storage…

Defs to work with special locations in Orchestrator: Robot, User (TODO), User + Robot (TODO)

Group OS…

Interaction with shell on the Orchestrator user session.

Group Process…

Interaction with some process on the Orchestrator user session.

Group Processor…

Work with Processor queue (see …).

Group Python…

Work with extra python modules.

Group RDPSession…

Interaction with RDP session, where you can manage some robots.

Group Web…

Manipulate the Orchestrator WEB side.

Group UAC…

Manipulate the User Access Controls (actual for the Orchestrator WEB access for the business users)

Group Scheduler…

Work with activity scheduling.

Functions:

ActivityItemCreate(inDef[, inArgList, …])

Create activity item.

ActivityItemDefAliasCreate(inDef[, …])

Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment)

ActivityItemDefAliasModulesLoad()

Load all def from sys.modules.

ActivityItemDefAliasUpdate(inDef, inAliasStr)

Update alias for def (can be used in ActivityItem in field Def).

ActivityItemHelperDefAutofill(inDef)

Detect def by the name and prepare the activity item dict with values.

ActivityItemHelperDefList([inDefQueryStr])

Create list of the available Def names in activity item. You can use query def filter via arg inDefQueryStr

AgentActivityItemAdd(inHostNameStr, …[, …])

Add activity in AgentDict.

AgentActivityItemExists(inHostNameStr, …)

Check by GUID if ActivityItem has exists in request list.

AgentActivityItemReturnExists(inGUIDStr[, …])

Check by GUID if ActivityItem has been executed and result has come to the Orchestrator

AgentActivityItemReturnGet(inGUIDStr[, …])

Work synchroniously! Wait while result will be recieved.

AgentOSCMD(inHostNameStr, inUserStr, inCMDStr)

Send CMD to OS thought the pyOpenRPA.Agent daemon.

AgentOSFileBinaryDataBase64StrAppend(…[, …])

Append binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission)

AgentOSFileBinaryDataBase64StrCreate(…[, …])

Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission)

AgentOSFileBinaryDataBase64StrReceive(…[, …])

Read binary file and encode in base64 to transmit (safe for JSON transmition)

AgentOSFileBinaryDataBytesCreate(…[, …])

Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmition)

AgentOSFileBinaryDataReceive(inHostNameStr, …)

Read binary file from agent (synchronious)

AgentOSFileSend(inHostNameStr, inUserStr, …)

Send the file from the Orchestrator to Agent (synchroniously) pyOpenRPA.Agent daemon process (safe for JSON transmition).

AgentOSFileTextDataStrCreate(inHostNameStr, …)

Create text file by the string by the pyOpenRPA.Agent daemon process

AgentOSFileTextDataStrReceive(inHostNameStr, …)

Read text file in the agent GUI session

AgentOSLogoff(inHostNameStr, inUserStr)

Logoff the agent user session

AgentProcessWOExeUpperUserListGet(…[, …])

Return the process list only for the current user (where Agent is running) without .EXE in upper case.

GSettingsAutocleaner([inGSettings])

HIDDEN Interval gSettings auto cleaner def to clear some garbage.

GSettingsGet([inGSettings])

Get the GSettings from the singleton module.

GSettingsKeyListValueAppend(inValue[, …])

Append value in GSettings by the key list

GSettingsKeyListValueGet([inKeyList, …])

Get the value from the GSettings by the key list

GSettingsKeyListValueOperatorPlus(inValue[, …])

Execute plus operation between 2 lists (1:inValue and 2:gSettings by the inKeyList)

GSettingsKeyListValueSet(inValue[, …])

Set value in GSettings by the key list

OSCMD(inCMDStr[, inRunAsyncBool, inLogger])

OS send command in shell locally

OSCredentialsVerify(inUserStr, inPasswordStr)

Verify user credentials in windows.

OSLogoff()

Logoff the current orchestrator session :return:

OSRemotePCRestart(inHostStr[, inForceBool, …])

Send signal via power shell to restart remote PC ATTENTION: Orchestrator user need to have restart right on the Remote machine to restart PC.

Orchestrator([inGSettings, …])

Main def to start orchestrator

OrchestratorInitWait()

Wait thread while orc will process initial action.

OrchestratorIsAdmin()

Check if Orchestrator process is running as administrator

OrchestratorIsInited()

Check if Orchestrator initial actions were processed

OrchestratorLoggerGet()

Get the logger from the Orchestrator

OrchestratorPySearchInit(inGlobPatternStr[, …])

Search the py files by the glob and do the safe init (in try except).

OrchestratorRerunAsAdmin()

Check if not admin - then rerun orchestrator as administrator

OrchestratorRestart([inGSettings])

Orchestrator restart

OrchestratorScheduleGet()

Get the schedule (schedule.readthedocs.io) from the Orchestrator

OrchestratorSessionRestore([inGSettings])

Check _SessioLast… files in working directory. if exist - load into gsettings (from version 1.2.7) _SessionLast_GSettings.pickle (binary).

OrchestratorSessionSave([inGSettings])

Orchestrator session save in file (from version 1.2.7) _SessionLast_GSettings.pickle (binary)

OrchestratorThreadStart(inDef, *inArgList, …)

Execute def in new thread and pass some args with list and dict types

ProcessDefIntervalCall(inDef, inIntervalSecFloat)

Use this procedure if you need to run periodically some def.

ProcessIsStarted(inProcessNameWOExeStr)

Check if there is any running process that contains the given name processName.

ProcessListGet([inProcessNameWOExeList])

Return process list on the orchestrator machine sorted by Memory Usage.

ProcessStart(inPathStr, inArgList[, …])

Start process locally.

ProcessStop(inProcessNameWOExeStr, …[, …])

Stop process on the orchestrator machine.

ProcessorActivityItemAppend([inGSettings, …])

Create and add activity item in processor queue.

ProcessorActivityItemCreate(inDef[, …])

Create activity item.

ProcessorAliasDefCreate(inDef[, inAliasStr, …])

Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment) Deprecated.

ProcessorAliasDefUpdate(inDef, inAliasStr[, …])

Update alias for def (can be used in ActivityItem in field Def).

PythonStart(inModulePathStr, inDefNameStr[, …])

Import module and run def in the Orchestrator process.

RDPSessionCMDRun(inRDPSessionKeyStr, inCMDStr)

Send CMD command to the RDP session “RUN” window

RDPSessionConnect(inRDPSessionKeyStr[, …])

Create new RDPSession in RobotRDPActive. Attention - activity will be ignored if RDP key is already exists

RDPSessionDisconnect(inRDPSessionKeyStr[, …])

Disconnect the RDP session and stop monitoring it.

RDPSessionDublicatesResolve(inGSettings)

DEVELOPING Search duplicates in GSettings RDPlist !def is developing!

RDPSessionFileStoredRecieve(…[, inGSettings])

Recieve file from RDP session to the Orchestrator session using shared drive in RDP (see RDP Configuration Dict, Shared drive)

RDPSessionFileStoredSend(inRDPSessionKeyStr, …)

Send file from Orchestrator session to the RDP session using shared drive in RDP (see RDP Configuration Dict, Shared drive)

RDPSessionLogoff(inRDPSessionKeyStr[, …])

Logoff the RDP session from the Orchestrator process (close all apps in session when logoff)

RDPSessionMonitorStop(inRDPSessionKeyStr[, …])

Stop monitoring the RDP session by the Orchestrator process.

RDPSessionProcessStartIfNotRunning(…[, …])

Start process in RDP if it is not running (check by the arg inProcessNameWEXEStr)

RDPSessionProcessStop(inRDPSessionKeyStr, …)

Send CMD command to the RDP session “RUN” window.

RDPSessionReconnect(inRDPSessionKeyStr[, …])

Reconnect the RDP session

RDPSessionResponsibilityCheck(inRDPSessionKeyStr)

DEVELOPING, MAYBE NOT USEFUL Check RDP Session responsibility TODO NEED DEV + TEST

RDPTemplateCreate(inLoginStr, inPasswordStr)

Create RDP connect dict item/ Use it connect/reconnect (Orchestrator.RDPSessionConnect)

SchedulerActivityTimeAddWeekly([…])

Add activity item list in scheduler.

Start([inDumpRestoreBool, …])

Start the orchestrator threads execution

StorageRobotExists(inRobotNameStr)

Check if robot storage exists

StorageRobotGet(inRobotNameStr)

Get the robot storage by the robot name.

UACKeyListCheck(inRequest, inRoleKeyList)

Check is client is has access for the key list

UACSuperTokenUpdate(inSuperTokenStr[, …])

Add supertoken for the all access (it is need for the robot communication without human)

UACUpdate(inADLoginStr[, inADStr, …])

Update user access (UAC)

UACUserDictGet(inRequest)

Return user UAC hierarchy dict of the inRequest object.

WebAuditMessageCreate([inRequest, …])

Create message string with request user details (IP, Login etc…).

WebCPUpdate(inCPKeyStr[, inHTMLRenderDef, …])

Add control panel HTML, JSON generator or JS when page init

WebListenCreate([inServerKeyStr, …])

Create listen interface for the web server

WebRequestGet()

Return the web request instance if current thread was created by web request from client.

WebRequestParseBodyBytes([inRequest])

Extract the body in bytes from the request

WebRequestParseBodyJSON([inRequest])

Extract the body in dict/list from the request

WebRequestParseBodyStr([inRequest])

Extract the body in str from the request

WebRequestParseFile([inRequest])

Parse the request - extract the file (name, body in bytes)

WebRequestParsePath([inRequest])

Parse the request - extract the url.

WebRequestResponseSend(inResponeStr[, inRequest])

Send response for the request

WebURLConnectDef(inMethodStr, inURLStr, …)

Connect URL to DEF

WebURLConnectFile(inMethodStr, inURLStr, …)

Connect URL to File

WebURLConnectFolder(inMethodStr, inURLStr, …)

Connect URL to Folder

WebUserInfoGet([inRequest])

Return User info about request

WebUserIsSuperToken([inRequest, inGSettings])

Return bool if request is authentificated with supetoken (token which is never expires)

WebUserUACHierarchyGet([inRequest])

Return User UAC Hierarchy DICT Return {…}

pyOpenRPA.Orchestrator.__Orchestrator__.ActivityItemCreate(inDef, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None, inGUIDStr=None, inThreadBool=False)[source]

Create activity item. Activity item can be used as list item in ProcessorActivityItemAppend or in Processor.ActivityListExecute.

# USAGE
from pyOpenRPA import Orchestrator

# EXAMPLE 1
def TestDef(inArg1Str, inGSettings, inLogger):
    pass
lActivityItem = Orchestrator.ActivityItemCreate(
    inDef = TestDef,
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = "inGSettings",
    inArgLoggerStr = "inLogger")
# lActivityItem:
#   {
#       "Def":TestDef,
#       "ArgList":inArgList,
#       "ArgDict":inArgDict,
#       "ArgGSettings": "inArgGSettings",
#       "ArgLogger": "inLogger"
#   }

# EXAMPLE 2
def TestDef(inArg1Str):
    pass
Orchestrator.ActivityItemDefAliasUpdate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
lActivityItem = Orchestrator.ActivityItemCreate(
    inDef = "TestDefAlias",
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = None,
    inArgLoggerStr = None)
# lActivityItem:
#   {
#       "Def":"TestDefAlias",
#       "ArgList":inArgList,
#       "ArgDict":inArgDict,
#       "ArgGSettings": None,
#       "ArgLogger": None
#   }
Parameters
  • inDef – def link or def alias (look gSettings[“Processor”][“AliasDefDict”])

  • inArgList – Args list for the Def

  • inArgDict – Args dict for the def

  • inArgGSettingsStr – Name of def argument of the GSettings dict

  • inArgLoggerStr – Name of def argument of the logging object

  • inGUIDStr – GUID which you can specify. If None the GUID will be generated

  • inThreadBool – True - execute ActivityItem in new thread; False - in processor thread

Returns

{}

pyOpenRPA.Orchestrator.__Orchestrator__.ActivityItemDefAliasCreate(inDef, inAliasStr=None, inGSettings=None)[source]

Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment)

# USAGE
from pyOpenRPA import Orchestrator

def TestDef():
    pass
lAliasStr = Orchestrator.ActivityItemDefAliasCreate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
# Now you can call TestDef by the alias from var lAliasStr with help of ActivityItem (key Def = lAliasStr)
Parameters
  • inGSettings – Global settings dict (singleton)

  • inDef – Def

  • inAliasStr – String alias for associated def

Returns

str Alias string (Alias can be regenerated if previous alias was occupied)

pyOpenRPA.Orchestrator.__Orchestrator__.ActivityItemDefAliasModulesLoad()[source]

Load all def from sys.modules… in ActivityItem def alias dict

Returns

None

pyOpenRPA.Orchestrator.__Orchestrator__.ActivityItemDefAliasUpdate(inDef, inAliasStr, inGSettings=None)[source]

Update alias for def (can be used in ActivityItem in field Def). !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment)

# USAGE
from pyOpenRPA import Orchestrator

def TestDef():
    pass
Orchestrator.ActivityItemDefAliasUpdate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
# Now you can call TestDef by the alias "TestDefAlias" with help of ActivityItem (key Def = "TestDefAlias")
Parameters
  • inGSettings – Global settings dict (singleton)

  • inDef – Def

  • inAliasStr – String alias for associated def

Returns

str Alias string

pyOpenRPA.Orchestrator.__Orchestrator__.ActivityItemHelperDefAutofill(inDef)[source]

Detect def by the name and prepare the activity item dict with values.

Parameters

inDef

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.ActivityItemHelperDefList(inDefQueryStr=None)[source]

Create list of the available Def names in activity item. You can use query def filter via arg inDefQueryStr

Parameters

inDefStr

Returns

[“ActivityItemDefAliasUpdate”, “ActivityItemDefAliasCreate”, etc…]

pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd(inHostNameStr, inUserStr, inActivityItemDict, inGSettings=None)[source]

Add activity in AgentDict. Check if item is created

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr – Agent host name

  • inUserStr – User login, where agent is based

  • inActivityItemDict – ActivityItem

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemExists(inHostNameStr, inUserStr, inGUIDStr, inGSettings=None)[source]

Check by GUID if ActivityItem has exists in request list. If exist - the result response has not been recieved from the agent

Parameters
  • inGSettings – Global settings dict (singleton)

  • inGUIDStr – GUID String of the ActivityItem

Returns

True - ActivityItem is exist in AgentDict ; False - else case

pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists(inGUIDStr, inGSettings=None)[source]

Check by GUID if ActivityItem has been executed and result has come to the Orchestrator

Parameters
  • inGSettings – Global settings dict (singleton)

  • inGUIDStr – GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

Returns

True - result has been received from the Agent to orc; False - else case

pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet(inGUIDStr, inCheckIntervalSecFloat=0.5, inGSettings=None)[source]

Work synchroniously! Wait while result will be recieved. Get the result of the ActivityItem execution on the Agent side. Before this please check by the def AgentActivityItemReturnExists that result has come to the Orchestrator

!ATTENTION! Use only after Orchestrator initialization! Before orchestrator init exception will be raised.

Parameters
  • inGSettings – Global settings dict (singleton)

  • inGUIDStr – GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

  • inCheckIntervalSecFloat – Interval in sec of the check Activity Item result

Returns

Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD(inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=True, inSendOutputToOrchestratorLogsBool=True, inCMDEncodingStr='cp1251', inGSettings=None, inCaptureBool=True)[source]

Send CMD to OS thought the pyOpenRPA.Agent daemon. Result return to log + Orchestrator by the A2O connection

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr – Agent host name in upper case (example “RPA01”, “RPA_99” and so on). Active agent session you can see on the orchestrator dashboard as Orchestrator admin

  • inUserStr – Agent user name in upper case (example “UserRPA”). Active agent session you can see on the orchestrator dashboard as Orchestrator admin

  • inCMDStr – command to execute on the Agent session

  • inRunAsyncBool – True - Agent processor don’t wait execution; False - Agent processor wait cmd execution

  • inSendOutputToOrchestratorLogsBool – True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True

  • inCMDEncodingStr – Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is “cp1251” early was “cp866” - need test

  • inCaptureBool – !ATTENTION! If you need to start absolutely encapsulated app - set this flag as False. If you set True - the app output will come to Agent

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrAppend(inHostNameStr, inUserStr, inFilePathStr, inFileDataBase64Str, inGSettings=None)[source]

Append binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission)

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr

  • inUserStr

  • inFilePathStr

  • inFileDataBase64Str

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate(inHostNameStr, inUserStr, inFilePathStr, inFileDataBase64Str, inGSettings=None)[source]

Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission)

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr

  • inUserStr

  • inFilePathStr

  • inFileDataBase64Str

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrReceive(inHostNameStr, inUserStr, inFilePathStr, inGSettings=None)[source]

Read binary file and encode in base64 to transmit (safe for JSON transmition)

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr

  • inUserStr

  • inFilePathStr – File path to read

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate(inHostNameStr, inUserStr, inFilePathStr, inFileDataBytes, inGSettings=None)[source]

Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmition)

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr

  • inUserStr

  • inFilePathStr

  • inFileDataBytes

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataReceive(inHostNameStr, inUserStr, inFilePathStr)[source]

Read binary file from agent (synchronious)

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr

  • inUserStr

  • inFilePathStr – File path to read

Returns

file data bytes

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileSend(inHostNameStr, inUserStr, inOrchestratorFilePathStr, inAgentFilePathStr, inGSettings=None)[source]

Send the file from the Orchestrator to Agent (synchroniously) pyOpenRPA.Agent daemon process (safe for JSON transmition). Work safety with big files Thread safe - you can call def even if you dont init the orchestrator - def will be executed later

param inGSettings

Global settings dict (singleton)

param inHostNameStr

param inUserStr

param inFilePathStr

param inFileDataBytes

return

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileTextDataStrCreate(inHostNameStr, inUserStr, inFilePathStr, inFileDataStr, inEncodingStr='utf-8', inGSettings=None)[source]

Create text file by the string by the pyOpenRPA.Agent daemon process

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr

  • inUserStr

  • inFilePathStr

  • inFileDataStr

  • inEncodingStr

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileTextDataStrReceive(inHostNameStr, inUserStr, inFilePathStr, inEncodingStr='utf-8', inGSettings=None)[source]

Read text file in the agent GUI session

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr

  • inUserStr

  • inFilePathStr – File path to read

  • inEncodingStr – Text file encoding. Default ‘utf-8’

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSLogoff(inHostNameStr, inUserStr)[source]

Logoff the agent user session

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.AgentProcessWOExeUpperUserListGet(inHostNameStr, inUserStr, inGSettings=None)[source]

Return the process list only for the current user (where Agent is running) without .EXE in upper case. Can use in ActivityItem from Orchestrator to Agent

Parameters
  • inGSettings – Global settings dict (singleton)

  • inHostNameStr

  • inUserStr

Returns

GUID String of the ActivityItem - you can wait (sync or async) result by this guid!

pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsAutocleaner(inGSettings=None)[source]

HIDDEN Interval gSettings auto cleaner def to clear some garbage.

Parameters

inGSettings – Global settings dict (singleton)

Returns

None

pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsGet(inGSettings=None)[source]

Get the GSettings from the singleton module.

Parameters

inGSettings – You can pass some GSettings to check if it equal to base gsettings. If not equal - def will merge it

Returns

GSettings

pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsKeyListValueAppend(inValue, inKeyList=None, inGSettings=None)[source]

Append value in GSettings by the key list

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.GSettingsKeyListValueAppend(
    inGSettings = gSettings,
    inValue = "NewValue",
    inKeyList=["NewKeyDict","NewKeyList"]):
# result inGSettings: {
#    ... another keys in gSettings ...,
#    "NewKeyDict":{
#        "NewKeyList":[
#            "NewValue"
#        ]
#    }
#}
Parameters
  • inGSettings – Global settings dict (singleton)

  • inValue – Any value to be appended in gSettings Dict by the key list

  • inKeyList – List of the nested keys (see example)

Returns

True every time

pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsKeyListValueGet(inKeyList=None, inGSettings=None)[source]

Get the value from the GSettings by the key list

Parameters
  • inGSettings – Global settings dict (singleton)

  • inKeyList

Returns

value any type

pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsKeyListValueOperatorPlus(inValue, inKeyList=None, inGSettings=None)[source]

Execute plus operation between 2 lists (1:inValue and 2:gSettings by the inKeyList)

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.GSettingsKeyListValueOperatorPlus(
    inGSettings = gSettings,
    inValue = [1,2,3],
    inKeyList=["NewKeyDict","NewKeyList"]):
# result inGSettings: {
#    ... another keys in gSettings ...,
#    "NewKeyDict":{
#        "NewKeyList":[
#            "NewValue",
#            1,
#            2,
#            3
#        ]
#    }
#}
Parameters
  • inGSettings – Global settings dict (singleton)

  • inValue – List with values to be merged with list in gSettings

  • inKeyList – List of the nested keys (see example)

Returns

True every time

pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsKeyListValueSet(inValue, inKeyList=None, inGSettings=None)[source]

Set value in GSettings by the key list

Parameters
  • inGSettings – Global settings dict (singleton)

  • inValue

  • inKeyList

Returns

bool

pyOpenRPA.Orchestrator.__Orchestrator__.OSCMD(inCMDStr, inRunAsyncBool=True, inLogger=None)[source]

OS send command in shell locally

Parameters
  • inCMDStr

  • inRunAsyncBool

  • inLogger

Returns

CMD result string

pyOpenRPA.Orchestrator.__Orchestrator__.OSCredentialsVerify(inUserStr, inPasswordStr, inDomainStr='')[source]

Verify user credentials in windows. Return bool

Parameters
  • inUserStr

  • inPasswordStr

  • inDomainStr

Returns

True - Credentials are actual; False - Credentials are not actual

pyOpenRPA.Orchestrator.__Orchestrator__.OSLogoff()[source]

Logoff the current orchestrator session :return:

pyOpenRPA.Orchestrator.__Orchestrator__.OSRemotePCRestart(inHostStr, inForceBool=True, inLogger=None)[source]

Send signal via power shell to restart remote PC ATTENTION: Orchestrator user need to have restart right on the Remote machine to restart PC.

Parameters
  • inLogger – logger to log powershell result in logs

  • inHostStr – PC hostname which you need to restart.

  • inForceBool – True - send signal to force retart PC; False - else case

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.Orchestrator(inGSettings=None, inDumpRestoreBool=True, inRunAsAdministratorBool=True)[source]

Main def to start orchestrator

Parameters
  • inGSettings

  • inDumpRestoreBool

  • inRunAsAdministratorBool

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorInitWait() → None[source]

Wait thread while orc will process initial action. ATTENTION: DO NOT CALL THIS DEF IN THREAD WHERE ORCHESTRATOR MUST BE INITIALIZED - INFINITE LOOP

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorIsAdmin()[source]

Check if Orchestrator process is running as administrator

Returns

True - run as administrator; False - not as administrator

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorIsInited() → bool[source]

Check if Orchestrator initial actions were processed

Returns

True - orc is already inited; False - else

Return type

bool

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorLoggerGet() → logging.Logger[source]

Get the logger from the Orchestrator

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorPySearchInit(inGlobPatternStr, inDefStr=None, inDefArgNameGSettingsStr=None, inAsyncInitBool=False)[source]

Search the py files by the glob and do the safe init (in try except). Also add inited module in sys.modules as imported (module name = file name without extension). You can init CP in async way! .. code-block:: python

# USAGE VAR 1 (without the def auto call) # Autoinit control panels starts with CP_ Orchestrator.OrchestratorPySearchInit(inGlobPatternStr=”ControlPanelCP_*.py”)

# USAGE VAR 2 (with the def auto call) - for the backward compatibility CP for the Orchestrator ver. < 1.2.7 # Autoinit control panels starts with CP_ Orchestrator.OrchestratorPySearchInit(inGlobPatternStr=”ControlPanelCP_*.py”, inDefStr=”SettingsUpdate”, inDefArgNameGSettingsStr=”inGSettings”)

# INFO: The code above will replace the code below ## !!! 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.”)

Parameters
  • inGlobPatternStr – example”..***X64*.cmd”

  • inDefStr – OPTIONAL The string name of the def. For backward compatibility if you need to auto call some def from initialized module

  • inDefArgNameGSettingsStr – OPTIONAL The name of the GSettings argument in def (if exists)

  • inAsyncInitBool – OPTIONAL True - init py modules in many threads - parallel execution. False (default) - sequence execution

Returns

{ “ModuleNameStr”:{“PyPathStr”: “”, “Module”: …}, …}

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorRerunAsAdmin()[source]

Check if not admin - then rerun orchestrator as administrator

Returns

True - run as administrator; False - not as administrator

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorRestart(inGSettings=None)[source]

Orchestrator restart

Parameters

inGSettings – Global settings dict (singleton)

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorScheduleGet() → <module ‘schedule’ from ‘c:\abs\archive\scopesrcul\pyopenrpa\resources\wpy64-3720\python-3.7.2.amd64\lib\site-packages\schedule\__init__.py’>[source]

Get the schedule (schedule.readthedocs.io) from the Orchestrator

Fro example you can use:

Returns

schedule module. Example see here https://schedule.readthedocs.io/en/stable/examples.html

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorSessionRestore(inGSettings=None)[source]

Check _SessioLast… files in working directory. if exist - load into gsettings (from version 1.2.7)

_SessionLast_GSettings.pickle (binary)

(above the version 1.2.7)

_SessionLast_RDPList.json (encoding = “utf-8”) _SessionLast_StorageDict.pickle (binary)

Parameters

inGSettings – Global settings dict (singleton)

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorSessionSave(inGSettings=None)[source]

Orchestrator session save in file (from version 1.2.7)

_SessionLast_GSettings.pickle (binary)

(above the version 1.2.7)

_SessionLast_RDPList.json (encoding = “utf-8”) _SessionLast_StorageDict.pickle (binary)

Parameters

inGSettings – Global settings dict (singleton)

Returns

True every time

pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorThreadStart(inDef, *inArgList, **inArgDict)[source]

Execute def in new thread and pass some args with list and dict types

Parameters
  • inDef – Python Def

  • inArgList – args as list

  • inArgDict – args as dict

Returns

threading.Thread object

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessDefIntervalCall(inDef, inIntervalSecFloat, inIntervalAsyncBool=False, inDefArgList=None, inDefArgDict=None, inDefArgGSettingsNameStr=None, inDefArgLoggerNameStr=None, inExecuteInNewThreadBool=True, inLogger=None, inGSettings=None)[source]

Use this procedure if you need to run periodically some def. Set def, args, interval and enjoy :)

Parameters
  • inGSettings – global settings

  • inDef – def link, which will be called with interval inIntervalSecFloat

  • inIntervalSecFloat – Interval in seconds between call

  • inIntervalAsyncBool – False - wait interval before next call after the previous iteration result; True - wait interval after previous iteration call

  • inDefArgList – List of the args in def. Default None (empty list)

  • inDefArgDict – Dict of the args in def. Default None (empty dict)

  • inDefArgGSettingsNameStr – Name of the GSettings arg name for def (optional)

  • inDefArgLoggerNameStr – Name of the Logger arg name for def (optional). If Use - please check fill of the inLogger arg.

  • inExecuteInNewThreadBool – True - create new thread for the periodic execution; False - execute in current thread. Default: True

  • inLogger – logging def if some case is appear

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted(inProcessNameWOExeStr)[source]

Check if there is any running process that contains the given name processName.

# USAGE
from pyOpenRPA import Orchestrator

lProcessIsStartedBool = Orchestrator.ProcessIsStarted(inProcessNameWOExeStr = "notepad")
# lProcessIsStartedBool is True - notepad.exe is running on the Orchestrator machine
Parameters

inProcessNameWOExeStr – Process name WithOut (WO) ‘.exe’ postfix. Example: “notepad” (not “notepad.exe”)

Returns

True - process is running on the orchestrator machine; False - process is not running on the orchestrator machine

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessListGet(inProcessNameWOExeList=None)[source]

Return process list on the orchestrator machine sorted by Memory Usage. You can determine the list of the processes you are interested - def will return the list about it.

# USAGE
from pyOpenRPA import Orchestrator

lProcessList = Orchestrator.ProcessListGet()
# Return the list of the process on the machine.
# !ATTENTION! RUn orchestrator as administrator to get all process list on the machine.
Parameters

inProcessNameWOExeList

Returns

{

“ProcessWOExeList”: [“notepad”,”…”], “ProcessWOExeUpperList”: [“NOTEPAD”,”…”], “ProcessDetailList”: [

{

‘pid’: 412, ‘username’: “DESKTOPUSER”, ‘name’: ‘notepad.exe’, ‘vms’: 13.77767775, ‘NameWOExeUpperStr’: ‘NOTEPAD’, ‘NameWOExeStr’: “‘notepad’”},

{…}]

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStart(inPathStr, inArgList, inStopProcessNameWOExeStr=None)[source]

Start process locally. Extra feature: Use inStopProcessNameWOExeStr to stop the execution if current process is running.

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.ProcessStart(
    inPathStr = "notepad"
    inArgList = []
    inStopProcessNameWOExeStr = "notepad")
# notepad.exe will be started if no notepad.exe is active on the machine
Parameters
  • inPathStr – Command to send in CMD

  • inArgList – List of the arguments for the CMD command. Example: [“test.txt”]

  • inStopProcessNameWOExeStr – Trigger: stop execution if process is running. Process name WithOut (WO) ‘.exe’ postfix. Example: “notepad” (not “notepad.exe”)

Returns

None - nothing is returned. If process will not start -exception will be raised

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStop(inProcessNameWOExeStr, inCloseForceBool, inUserNameStr='%username%')[source]

Stop process on the orchestrator machine. You can set user session on the machine and set flag about to force close process.

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.ProcessStop(
    inProcessNameWOExeStr = "notepad"
    inCloseForceBool = True
    inUserNameStr = "USER_99")
# Will close process "notepad.exe" on the user session "USER_99" (!ATTENTION! if process not exists no exceptions will be raised)
Parameters
  • inProcessNameWOExeStr – Process name WithOut (WO) ‘.exe’ postfix. Example: “notepad” (not “notepad.exe”)

  • inCloseForceBool – True - do force close. False - send signal to safe close (!ATTENTION! - Safe close works only in orchestrator session. Win OS doens’t allow to send safe close signal between GUI sessions)

  • inUserNameStr – User name which is has current process to close. Default value is close process on the Orchestrator session

Returns

None

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessorActivityItemAppend(inGSettings=None, inDef=None, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None, inActivityItemDict=None)[source]

Create and add activity item in processor queue.

# USAGE
from pyOpenRPA import Orchestrator

# EXAMPLE 1
def TestDef(inArg1Str, inGSettings, inLogger):
    pass
lActivityItem = Orchestrator.ProcessorActivityItemAppend(
    inGSettings = gSettingsDict,
    inDef = TestDef,
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = "inGSettings",
    inArgLoggerStr = "inLogger")
# Activity have been already append in the processor queue

# EXAMPLE 2
def TestDef(inArg1Str):
    pass
Orchestrator.ProcessorAliasDefUpdate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
lActivityItem = Orchestrator.ProcessorActivityItemCreate(
    inDef = "TestDefAlias",
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = None,
    inArgLoggerStr = None)
Orchestrator.ProcessorActivityItemAppend(
    inGSettings = gSettingsDict,
    inActivityItemDict = lActivityItem)
# Activity have been already append in the processor queue
Parameters
  • inGSettings – Global settings dict (singleton)

  • inDef – def link or def alias (look gSettings[“Processor”][“AliasDefDict”])

  • inArgList – Args list for the Def

  • inArgDict – Args dict for the Def

  • inArgGSettingsStr – Name of def argument of the GSettings dict

  • inArgLoggerStr – Name of def argument of the logging object

  • inActivityItemDict – Fill if you already have ActivityItemDict (don’t fill inDef, inArgList, inArgDict, inArgGSettingsStr, inArgLoggerStr)

:return ActivityItem GUIDStr

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessorActivityItemCreate(inDef, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None, inGUIDStr=None, inThreadBool=False)[source]

Create activity item. Activity item can be used as list item in ProcessorActivityItemAppend or in Processor.ActivityListExecute. Deprecated. See ActivityItemCreate .. code-block:: python

# USAGE from pyOpenRPA import Orchestrator

# EXAMPLE 1 def TestDef(inArg1Str, inGSettings, inLogger):

pass

lActivityItem = Orchestrator.ProcessorActivityItemCreate(

inDef = TestDef, inArgList=[], inArgDict={“inArg1Str”: “ArgValueStr”}, inArgGSettingsStr = “inGSettings”, inArgLoggerStr = “inLogger”)

# lActivityItem: # { # “Def”:TestDef, # “ArgList”:inArgList, # “ArgDict”:inArgDict, # “ArgGSettings”: “inArgGSettings”, # “ArgLogger”: “inLogger” # }

# EXAMPLE 2 def TestDef(inArg1Str):

pass

Orchestrator.ProcessorAliasDefUpdate(

inGSettings = gSettings, inDef = TestDef, inAliasStr=”TestDefAlias”)

lActivityItem = Orchestrator.ProcessorActivityItemCreate(

inDef = “TestDefAlias”, inArgList=[], inArgDict={“inArg1Str”: “ArgValueStr”}, inArgGSettingsStr = None, inArgLoggerStr = None)

# lActivityItem: # { # “Def”:”TestDefAlias”, # “ArgList”:inArgList, # “ArgDict”:inArgDict, # “ArgGSettings”: None, # “ArgLogger”: None # }

Parameters
  • inDef – def link or def alias (look gSettings[“Processor”][“AliasDefDict”])

  • inArgList – Args list for the Def

  • inArgDict – Args dict for the def

  • inArgGSettingsStr – Name of def argument of the GSettings dict

  • inArgLoggerStr – Name of def argument of the logging object

  • inGUIDStr – GUID which you can specify. If None the GUID will be generated

  • inThreadBool – True - execute ActivityItem in new thread; False - in processor thread

Returns

{}

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessorAliasDefCreate(inDef, inAliasStr=None, inGSettings=None)[source]

Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment) Deprecated. See ActivityItemDefAliasCreate

# USAGE
from pyOpenRPA import Orchestrator

def TestDef():
    pass
lAliasStr = Orchestrator.ProcessorAliasDefCreate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
# Now you can call TestDef by the alias from var lAliasStr with help of ActivityItem (key Def = lAliasStr)
Parameters
  • inGSettings – Global settings dict (singleton)

  • inDef – Def

  • inAliasStr – String alias for associated def

Returns

str Alias string (Alias can be regenerated if previous alias was occupied)

pyOpenRPA.Orchestrator.__Orchestrator__.ProcessorAliasDefUpdate(inDef, inAliasStr, inGSettings=None)[source]

Update alias for def (can be used in ActivityItem in field Def). !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment) Deprecated. See ActivityItemDefAliasUpdate

# USAGE
from pyOpenRPA import Orchestrator

def TestDef():
    pass
Orchestrator.ProcessorAliasDefUpdate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
# Now you can call TestDef by the alias "TestDefAlias" with help of ActivityItem (key Def = "TestDefAlias")
Parameters
  • inGSettings – Global settings dict (singleton)

  • inDef – Def

  • inAliasStr – String alias for associated def

Returns

str Alias string

pyOpenRPA.Orchestrator.__Orchestrator__.PythonStart(inModulePathStr, inDefNameStr, inArgList=None, inArgDict=None, inLogger=None)[source]

Import module and run def in the Orchestrator process.

Note

Import module will be each time when PythonStart def will be called.

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.PythonStart(
    inModulePathStr="ModuleToCall.py", # inModulePathStr: Working Directory\ModuleToCall.py
    inDefNameStr="TestDef")
# Import module in Orchestrator process and call def "TestDef" from module "ModuleToCall.py"
Parameters
  • inModulePathStr – Absolute or relative (working directory of the orchestrator process) path to the importing module .py

  • inDefNameStr – Def name in module

  • inArgList – List of the arguments for callable def

  • inArgDict – Dict of the named arguments for callable def

  • inLogger – Logger instance to log some information when PythonStart def is running

Returns

None

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionCMDRun(inRDPSessionKeyStr, inCMDStr, inModeStr='CROSSCHECK', inGSettings=None)[source]

Send CMD command to the RDP session “RUN” window

# USAGE
from pyOpenRPA import Orchestrator

lResultDict = Orchestrator.RDPSessionCMDRun(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inModeStr = 'LISTEN')
# Orchestrator will send CMD to RDP and return the result (see return section)
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inCMDStr – Any CMD string

  • inModeStr – Variants: “LISTEN” - Get result of the cmd command in result; “CROSSCHECK” - Check if the command was successfully sent “RUN” - Run without crosscheck and get clipboard

Returns

# OLD > True - CMD was executed successfully
{

“OutStr”: <> # Result string “IsResponsibleBool”: True|False # Flag is RDP is responsible - works only when inModeStr = CROSSCHECK

}

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionConnect(inRDPSessionKeyStr, inRDPTemplateDict=None, inHostStr=None, inPortStr=None, inLoginStr=None, inPasswordStr=None, inGSettings=None, inRedirectClipboardBool=True)[source]
Create new RDPSession in RobotRDPActive. Attention - activity will be ignored if RDP key is already exists

2 way of the use

Var 1 (Main stream): inGSettings, inRDPSessionKeyStr, inRDPTemplateDict Var 2 (Backward compatibility): inGSettings, inRDPSessionKeyStr, inHostStr, inPortStr, inLoginStr, inPasswordStr

# USAGE
from pyOpenRPA import Orchestrator

lRDPItemDict = Orchestrator.RDPTemplateCreate(
    inLoginStr = "USER_99",
    inPasswordStr = "USER_PASS_HERE", inHostStr="127.0.0.1", inPortInt = 3389, inWidthPXInt = 1680,
    inHeightPXInt = 1050, inUseBothMonitorBool = False, inDepthBitInt = 32, inSharedDriveList=None)
Orchestrator.RDPSessionConnect(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inRDPTemplateDict = lRDPItemDict)
# Orchestrator will create RDP session by the lRDPItemDict configuration
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inRDPTemplateDict – RDP configuration dict with settings (see def Orchestrator.RDPTemplateCreate)

  • inHostStr – Backward compatibility from Orchestrator v 1.1.20. Use inRDPTemplateDict

  • inPortStr – Backward compatibility from Orchestrator v 1.1.20. Use inRDPTemplateDict

  • inLoginStr – Backward compatibility from Orchestrator v 1.1.20. Use inRDPTemplateDict

  • inPasswordStr – Backward compatibility from Orchestrator v 1.1.20. Use inRDPTemplateDict

Returns

True every time :)

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionDisconnect(inRDPSessionKeyStr, inBreakTriggerProcessWOExeList=None, inGSettings=None)[source]

Disconnect the RDP session and stop monitoring it.

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.RDPSessionDisconnect(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey")
# Orchestrator will disconnect RDP session and will stop to monitoring current RDP
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inBreakTriggerProcessWOExeList

    List of the processes, which will stop the execution. Example [“notepad”]

    Orchestrator look processes on the current machine

Returns

True every time

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionDublicatesResolve(inGSettings)[source]

DEVELOPING Search duplicates in GSettings RDPlist !def is developing!

Parameters

inGSettings – Global settings dict (singleton)

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionFileStoredRecieve(inRDPSessionKeyStr, inRDPFilePathStr, inHostFilePathStr, inGSettings=None)[source]

Recieve file from RDP session to the Orchestrator session using shared drive in RDP (see RDP Configuration Dict, Shared drive)

# USAGE
from pyOpenRPA import Orchestrator

lResultDict = Orchestrator.RDPSessionFileStoredRecieve(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inHostFilePathStr = "TESTDIR\Test.py",
    inRDPFilePathStr = "C:\RPA\TESTDIR\Test.py")
# Orchestrator will send CMD to RDP and return the result (see return section)
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inRDPFilePathStr – !Absolute! path to the destination file location on the RDP side. Example: “C:RPATESTDIRTest.py”

  • inHostFilePathStr – Relative or absolute path to the file location on the Orchestrator side. Example: “TESTDIRTest.py”

Returns

True every time

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionFileStoredSend(inRDPSessionKeyStr, inHostFilePathStr, inRDPFilePathStr, inGSettings=None)[source]

Send file from Orchestrator session to the RDP session using shared drive in RDP (see RDP Configuration Dict, Shared drive)

# USAGE
from pyOpenRPA import Orchestrator

lResultDict = Orchestrator.RDPSessionFileStoredSend(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inHostFilePathStr = "TESTDIR\Test.py",
    inRDPFilePathStr = "C:\RPA\TESTDIR\Test.py")
# Orchestrator will send CMD to RDP and return the result (see return section)
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inHostFilePathStr – Relative or absolute path to the file location on the Orchestrator side. Example: “TESTDIRTest.py”

  • inRDPFilePathStr – !Absolute! path to the destination file location on the RDP side. Example: “C:RPATESTDIRTest.py”

Returns

True every time

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionLogoff(inRDPSessionKeyStr, inBreakTriggerProcessWOExeList=None, inGSettings=None)[source]

Logoff the RDP session from the Orchestrator process (close all apps in session when logoff)

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.RDPSessionLogoff(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inBreakTriggerProcessWOExeList = ['Notepad'])
# Orchestrator will logoff the RDP session
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inBreakTriggerProcessWOExeList – List of the processes, which will stop the execution. Example [“notepad”]

Returns

True - logoff is successful

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionMonitorStop(inRDPSessionKeyStr, inGSettings=None)[source]

Stop monitoring the RDP session by the Orchestrator process. Current def don’t kill RDP session - only stop to track it (it can give )

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.RDPSessionMonitorStop(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey")
# Orchestrator will stop the RDP monitoring
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

Returns

True every time :>

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionProcessStartIfNotRunning(inRDPSessionKeyStr, inProcessNameWEXEStr, inFilePathStr, inFlagGetAbsPathBool=True, inGSettings=None)[source]

Start process in RDP if it is not running (check by the arg inProcessNameWEXEStr)

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.RDPSessionProcessStartIfNotRunning(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inProcessNameWEXEStr = 'Notepad.exe',
    inFilePathStr = "path\to    he\executable\file.exe"
    inFlagGetAbsPathBool = True)
# Orchestrator will start the process in RDP session
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inProcessNameWEXEStr – Process name with extension (.exe). This arg allow to check the process is running. Example: “Notepad.exe”

  • inFilePathStr – Path to run process if it is not running.

  • inFlagGetAbsPathBool – True - get abs path from the relative path in inFilePathStr. False - else case

Returns

True every time :)

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionProcessStop(inRDPSessionKeyStr, inProcessNameWEXEStr, inFlagForceCloseBool, inGSettings=None)[source]

Send CMD command to the RDP session “RUN” window.

# USAGE
from pyOpenRPA import Orchestrator

lResultDict = Orchestrator.RDPSessionProcessStop(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inProcessNameWEXEStr = 'notepad.exe',
    inFlagForceCloseBool = True)
# Orchestrator will send CMD to RDP and return the result (see return section)
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inProcessNameWEXEStr – Process name to kill. Example: ‘notepad.exe’

  • inFlagForceCloseBool – True - force close the process. False - safe close the process

Returns

True every time

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionReconnect(inRDPSessionKeyStr, inRDPTemplateDict=None, inGSettings=None)[source]

Reconnect the RDP session

# USAGE
from pyOpenRPA import Orchestrator

lRDPItemDict = Orchestrator.RDPTemplateCreate(
    inLoginStr = "USER_99",
    inPasswordStr = "USER_PASS_HERE", inHostStr="127.0.0.1", inPortInt = 3389, inWidthPXInt = 1680,
    inHeightPXInt = 1050, inUseBothMonitorBool = False, inDepthBitInt = 32, inSharedDriveList=None)
Orchestrator.RDPSessionReconnect(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inRDPTemplateDict = inRDPTemplateDict)
# Orchestrator will reconnect RDP session and will continue to monitoring current RDP
Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

  • inRDPTemplateDict – RDP configuration dict with settings (see def Orchestrator.RDPTemplateCreate)

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionResponsibilityCheck(inRDPSessionKeyStr, inGSettings=None)[source]

DEVELOPING, MAYBE NOT USEFUL Check RDP Session responsibility TODO NEED DEV + TEST

Parameters
  • inGSettings – Global settings dict (singleton)

  • inRDPSessionKeyStr – RDP Session string key - need for the further identification

Returns

True every time

pyOpenRPA.Orchestrator.__Orchestrator__.RDPTemplateCreate(inLoginStr, inPasswordStr, inHostStr='127.0.0.1', inPortInt=3389, inWidthPXInt=1680, inHeightPXInt=1050, inUseBothMonitorBool=False, inDepthBitInt=32, inSharedDriveList=None, inRedirectClipboardBool=True)[source]

Create RDP connect dict item/ Use it connect/reconnect (Orchestrator.RDPSessionConnect)

# USAGE
from pyOpenRPA import Orchestrator

lRDPItemDict = Orchestrator.RDPTemplateCreate(
    inLoginStr = "USER_99",
    inPasswordStr = "USER_PASS_HERE",
    inHostStr="127.0.0.1",
    inPortInt = 3389,
    inWidthPXInt = 1680,
    inHeightPXInt = 1050,
    inUseBothMonitorBool = False,
    inDepthBitInt = 32,
    inSharedDriveList=None)
#     lRDPTemplateDict= {  # Init the configuration item
#         "Host": "127.0.0.1", "Port": "3389", "Login": "USER_99", "Password": "USER_PASS_HERE",
#         "Screen": { "Width": 1680, "Height": 1050, "FlagUseAllMonitors": False, "DepthBit": "32" },
#         "SharedDriveList": ["c"],
#         "RedirectClipboardBool": True, # True - share clipboard to RDP; False - else
#         ###### Will updated in program ############
#         "SessionHex": "77777sdfsdf77777dsfdfsf77777777",  # Hex is created when robot runs, example ""
#         "SessionIsWindowExistBool": False, "SessionIsWindowResponsibleBool": False, "SessionIsIgnoredBool": False
#     }
Parameters
  • inLoginStr – User/Robot Login, example “USER_99”

  • inPasswordStr – Password, example “USER_PASS_HERE”

  • inHostStr – Host address, example “77.77.22.22”

  • inPortInt – RDP Port, example “3389” (default)

  • inWidthPXInt – Width of the remote desktop in pixels, example 1680

  • inHeightPXInt – Height of the remote desktop in pixels, example 1050

  • inUseBothMonitorBool – True - connect to the RDP with both monitors. False - else case

  • inDepthBitInt – Remote desktop bitness. Available: 32 or 24 or 16 or 15, example 32

  • inSharedDriveList – Host local disc to connect to the RDP session. Example: [“c”, “d”]

  • inRedirectClipboardBool – # True - share clipboard to RDP; False - else

Returns

{

“Host”: inHostStr, # Host address, example “77.77.22.22” “Port”: str(inPortInt), # RDP Port, example “3389” “Login”: inLoginStr, # Login, example “test” “Password”: inPasswordStr, # Password, example “test” “Screen”: {

”Width”: inWidthPXInt, # Width of the remote desktop in pixels, example 1680 “Height”: inHeightPXInt, # Height of the remote desktop in pixels, example 1050 # “640x480” or “1680x1050” or “FullScreen”. If Resolution not exists set full screen, example “FlagUseAllMonitors”: inUseBothMonitorBool, # True or False, example False “DepthBit”: str(inDepthBitInt) # “32” or “24” or “16” or “15”, example “32”

}, “SharedDriveList”: inSharedDriveList, # List of the Root sesion hard drives, example [“c”] “RedirectClipboardBool”: True, # True - share clipboard to RDP; False - else ###### Will updated in program ############ “SessionHex”: “77777sdfsdf77777dsfdfsf77777777”, # Hex is created when robot runs, example “” “SessionIsWindowExistBool”: False, # Flag if the RDP window is exist, old name “FlagSessionIsActive”. Check every n seconds , example False “SessionIsWindowResponsibleBool”: False, # Flag if RDP window is responsible (recieve commands). Check every nn seconds. If window is Responsible - window is Exist too , example False “SessionIsIgnoredBool”: False # Flag to ignore RDP window False - dont ignore, True - ignore, example False

}

pyOpenRPA.Orchestrator.__Orchestrator__.SchedulerActivityTimeAddWeekly(inTimeHHMMStr='23:55:', inWeekdayList=None, inActivityList=None, inGSettings=None)[source]

Add activity item list in scheduler. You can set weekday list and set time when launch. Activity list will be executed at planned time/day.

# USAGE
from pyOpenRPA import Orchestrator

# EXAMPLE 1
def TestDef(inArg1Str):
    pass
lActivityItem = Orchestrator.ProcessorActivityItemCreate(
    inDef = TestDef,
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = None,
    inArgLoggerStr = None)
Orchestrator.SchedulerActivityTimeAddWeekly(
    inGSettings = gSettingsDict,
    inTimeHHMMStr = "04:34",
    inWeekdayList=[2,3,4],
    inActivityList = [lActivityItem])
# Activity will be executed at 04:34 Wednesday (2), thursday (3), friday (4)
Parameters
  • inGSettings – Global settings dict (singleton)

  • inTimeHHMMStr – Activation time from “00:00” to “23:59”. Example: “05:29”

  • inWeekdayList – Week day list to initiate activity list. Use int from 0 (monday) to 6 (sunday) as list items. Example: [0,1,2,3,4]. Default value is everyday ([0,1,2,3,4,5,6])

  • inActivityList – Activity list structure

Returns

None

pyOpenRPA.Orchestrator.__Orchestrator__.Start(inDumpRestoreBool=True, inRunAsAdministratorBool=True)[source]

Start the orchestrator threads execution

Parameters
  • inDumpRestoreBool – True - restore data from the dumo

  • inRunAsAdministratorBool – True - rerun as admin if not

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.StorageRobotExists(inRobotNameStr)[source]

Check if robot storage exists

Parameters

inRobotNameStr – Robot name (case sensitive)

Returns

True - robot storage exist; False - does not exist

pyOpenRPA.Orchestrator.__Orchestrator__.StorageRobotGet(inRobotNameStr)[source]

Get the robot storage by the robot name. If Robot storage is not exist - function will create it

Parameters

inRobotNameStr – Robot name (case sensitive)

Returns

Dict

pyOpenRPA.Orchestrator.__Orchestrator__.UACKeyListCheck(inRequest, inRoleKeyList) → bool[source]

Check is client is has access for the key list

Parameters
  • inRequest – request handler (from http.server import BaseHTTPRequestHandler)

  • inRoleKeyList

Returns

bool

pyOpenRPA.Orchestrator.__Orchestrator__.UACSuperTokenUpdate(inSuperTokenStr, inGSettings=None)[source]

Add supertoken for the all access (it is need for the robot communication without human)

Parameters
  • inGSettings – Global settings dict (singleton)

  • inSuperTokenStr

pyOpenRPA.Orchestrator.__Orchestrator__.UACUpdate(inADLoginStr, inADStr='', inADIsDefaultBool=True, inURLList=None, inRoleHierarchyAllowedDict=None, inGSettings=None)[source]

Update user access (UAC)

Parameters
  • inGSettings – Global settings dict (singleton)

  • inADLoginStr

  • inADStr

  • inADIsDefaultBool

  • inURLList

  • inRoleHierarchyAllowedDict

pyOpenRPA.Orchestrator.__Orchestrator__.UACUserDictGet(inRequest) → dict[source]

Return user UAC hierarchy dict of the inRequest object. Empty dict - superuser access

Parameters

inRequest – request handler (from http.server import BaseHTTPRequestHandler)

Returns

user UAC hierarchy dict

pyOpenRPA.Orchestrator.__Orchestrator__.WebAuditMessageCreate(inRequest=None, inOperationCodeStr='-', inMessageStr='-')[source]

Create message string with request user details (IP, Login etc…). Very actual for IT security in big company.

# USAGE
from pyOpenRPA import Orchestrator

lWebAuditMessageStr = Orchestrator.WebAuditMessageCreate(
    inRequest = lRequest,
    inOperationCodeStr = "OP_CODE_1",
    inMessageStr="Success"):

# Log the WebAudit message
lLogger.info(lWebAuditMessageStr)
Parameters
  • inRequest – HTTP request handler. Optional if call def from request thread

  • inOperationCodeStr – operation code in string format (actual for IT audit in control panels)

  • inMessageStr – additional message after

Returns

format “WebAudit :: DOMAINUSER@101.121.123.12 :: operation code :: message”

pyOpenRPA.Orchestrator.__Orchestrator__.WebCPUpdate(inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None, inGSettings=None)[source]

Add control panel HTML, JSON generator or JS when page init

Parameters
  • inGSettings – Global settings dict (singleton)

  • inCPKeyStr

  • inHTMLRenderDef

  • inJSONGeneratorDef

  • inJSInitGeneratorDef

pyOpenRPA.Orchestrator.__Orchestrator__.WebListenCreate(inServerKeyStr='Default', inAddressStr='', inPortInt=80, inCertFilePEMPathStr=None, inKeyFilePathStr=None, inGSettings=None)[source]

Create listen interface for the web server

Parameters
  • inGSettings – Global settings dict (singleton)

  • inAddressStr – IP interface to listen

  • inPortInt – Port int to listen for HTTP default is 80; for HTTPS default is 443

  • inCertFilePEMPathStr – Path to .pem (base 64) certificate. Required for SSL connection. ATTENTION - do not use certificate with password

  • inKeyFilePathStr – Path to the private key file

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestGet()[source]

Return the web request instance if current thread was created by web request from client. else return None

pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyBytes(inRequest=None)[source]

Extract the body in bytes from the request

Parameters

inRequest – inRequest from the server. Optional if call def from request thread

Returns

Bytes or None

pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyJSON(inRequest=None)[source]

Extract the body in dict/list from the request

Parameters

inRequest – inRequest from the server. Optional if call def from request thread

Returns

dict or list

pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseBodyStr(inRequest=None)[source]

Extract the body in str from the request

Parameters

inRequest – inRequest from the server. Optional if call def from request thread

Returns

str or None

pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParseFile(inRequest=None)[source]

Parse the request - extract the file (name, body in bytes)

Parameters

inRequest – inRequest from the server. Optional if call def from request thread

Returns

(FileNameStr, FileBodyBytes) or (None, None)

pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestParsePath(inRequest=None)[source]

Parse the request - extract the url. Example: /pyOpenRPA/Debugging/DefHelper/…

Parameters

inRequest – inRequest from the server. Optional if call def from request thread

Returns

Str, Example: /pyOpenRPA/Debugging/DefHelper/…

pyOpenRPA.Orchestrator.__Orchestrator__.WebRequestResponseSend(inResponeStr, inRequest=None)[source]

Send response for the request

Parameters

inRequest – inRequest from the server. Optional if call def from request thread

Returns

pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef(inMethodStr, inURLStr, inMatchTypeStr, inDef, inContentTypeStr='application/octet-stream', inGSettings=None, inUACBool=None)[source]
Connect URL to DEF

“inMethodStr”:”GET|POST”, “inURLStr”: “/index”, #URL of the request “inMatchTypeStr”: “”, #”BeginWith|Contains|Equal|EqualCase”, “inContentTypeStr”: “”, #HTTP Content-type “inDef”: None #Function with str result

Parameters
  • inGSettings – Global settings dict (singleton)

  • inMethodStr – “GET|POST”,

  • inURLStr – example “/index”, #URL of the request

  • inMatchTypeStr – #”BeginWith|Contains|Equal|EqualCase”,

  • inDef – def arg allowed list: 2:[inRequest, inGSettings], 1: [inRequest], 0: []

  • inContentTypeStr – default: “application/octet-stream”

  • inUACBool – default: None; True - check user access before do this URL item. None - get Server flag if ask user

pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFile(inMethodStr, inURLStr, inMatchTypeStr, inFilePathStr, inContentTypeStr='application/octet-stream', inGSettings=None, inUACBool=None)[source]
Connect URL to File

“inMethodStr”:”GET|POST”, “inURLStr”: “/index”, #URL of the request “inMatchTypeStr”: “”, #”BeginWith|Contains|Equal|EqualCase”, “inFolderPathStr”: “”, #Absolute or relative path

Parameters
  • inGSettings – Global settings dict (singleton)

  • inMethodStr

  • inURLStr

  • inMatchTypeStr

  • inFilePathStr

  • inContentTypeStr

  • inUACBool – default: None; True - check user access before do this URL item. None - get Server flag if ask user

pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFolder(inMethodStr, inURLStr, inMatchTypeStr, inFolderPathStr, inGSettings=None, inUACBool=None)[source]
Connect URL to Folder

“inMethodStr”:”GET|POST”, “inURLStr”: “/Folder/”, #URL of the request “inMatchTypeStr”: “”, #”BeginWith|Contains|Equal|EqualCase”, “inFolderPathStr”: “”, #Absolute or relative path “inUACBool”

Parameters
  • inGSettings – Global settings dict (singleton)

  • inMethodStr

  • inURLStr

  • inMatchTypeStr

  • inFolderPathStr

  • inUACBool – default: None; True - check user access before do this URL item. None - get Server flag if ask user

pyOpenRPA.Orchestrator.__Orchestrator__.WebUserInfoGet(inRequest=None)[source]

Return User info about request

Parameters

inRequest – inRequest from the server. Optional if call def from request thread

Returns

{“DomainUpperStr”: “”, “UserNameUpperStr”: “”}

pyOpenRPA.Orchestrator.__Orchestrator__.WebUserIsSuperToken(inRequest=None, inGSettings=None)[source]

Return bool if request is authentificated with supetoken (token which is never expires)

Parameters
  • inRequest – inRequest from the server. Optional if call def from request thread

  • inGSettings – Global settings dict (singleton)

Returns

bool True - is supertoken; False - is not supertoken

pyOpenRPA.Orchestrator.__Orchestrator__.WebUserUACHierarchyGet(inRequest=None)[source]

Return User UAC Hierarchy DICT Return {…}

Parameters

inRequest – inRequest from the server. Optional if call def from request thread

Returns

UAC Dict {}

pyOpenRPA.Orchestrator.Web.Basic

Functions:

JSActivityListExecute(inActivityList[, …])

Create JS for execute activity list/ activity permanent

JSProcessorActivityListAdd(inActivityList[, …])

# Create JS for send activity list/ activity to the processor

pyOpenRPA.Orchestrator.Web.Basic.JSActivityListExecute(inActivityList, inGUIDRemoveBool=True)[source]

Create JS for execute activity list/ activity permanent USAGE: Orchestrator.Web.Basic.JSActivityListExecute(inActivityList, inGUIDRemoveBool = True)

Parameters
  • inActivityList – List of the activities (See __Orchestrator__.ProcessorActivityItemCreate)

  • inGUIDRemoveBool – True - remove GUID before generate JS (if GUID is not important)

Returns

JavaScript string for the front end

pyOpenRPA.Orchestrator.Web.Basic.JSProcessorActivityListAdd(inActivityList, inGUIDRemoveBool=True)[source]

# Create JS for send activity list/ activity to the processor # USAGE: Orchestrator.Web.Basic.JSProcessorActivityListAdd(inActivityList)

Parameters
  • inActivityList – List of the activities (See __Orchestrator__.ProcessorActivityItemCreate)

  • inGUIDRemoveBool – True - remove GUID before generate JS (if GUID is not important)

Returns

JavaScript string for the front end