From 1df423c09f4323c07c020e666fbbbd332daf45e3 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Thu, 15 Apr 2021 10:40:33 +0300 Subject: [PATCH] Add Orchestrator ProcessGSettingsget and ProcessLoggerGet --- .../Orchestrator/__Orchestrator__.py | 23 ++++++++++++- Wiki/ENG_Guide/html/Orchestrator/02_Defs.html | 32 ++++++++++++++++-- .../Orchestrator/__Orchestrator__.html | 23 ++++++++++++- Wiki/ENG_Guide/html/genindex.html | 8 +++-- Wiki/ENG_Guide/html/objects.inv | Bin 1344 -> 1356 bytes Wiki/ENG_Guide/html/searchindex.js | 2 +- .../markdown/Orchestrator/02_Defs.md | 28 +++++++++++++++ 7 files changed, 109 insertions(+), 7 deletions(-) diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index 7f8eb6c1..32e45861 100644 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -23,7 +23,7 @@ import uuid # Generate uuid import datetime # datetime #Единый глобальный словарь (За основу взять из Settings.py) -global gSettingsDict +gSettingsDict = None # AGENT DEFS @@ -942,6 +942,26 @@ def ProcessListGet(inProcessNameWOExeList=None): pass return lResult +def ProcessGSettingsGet(): + """ + Return GSettings (singleton) from global variable + + :return: + """ + global gSettingsDict + return gSettingsDict + +def ProcessLoggerGet(): + """ + Return Logger from global variable + + :return: + """ + global gSettingsDict + lResult = None + if "Logger" in gSettingsDict: lResult = gSettingsDict["Logger"] + return lResult + def ProcessDefIntervalCall(inDef, inIntervalSecFloat, inIntervalAsyncBool=False, inDefArgList=None, inDefArgDict=None, inExecuteInNewThreadBool=True, inLogger=None): """ Use this procedure if you need to run periodically some def. Set def, args, interval and enjoy :) @@ -1718,6 +1738,7 @@ def Orchestrator(inGSettings): else: # Code of your program here #mGlobalDict = Settings.Settings(sys.argv[1]) + global gSettingsDict gSettingsDict = inGSettings # Alias for old name in alg inGSettings["VersionStr"] = __version__ #Logger alias diff --git a/Wiki/ENG_Guide/html/Orchestrator/02_Defs.html b/Wiki/ENG_Guide/html/Orchestrator/02_Defs.html index c971ca33..8285237b 100644 --- a/Wiki/ENG_Guide/html/Orchestrator/02_Defs.html +++ b/Wiki/ENG_Guide/html/Orchestrator/02_Defs.html @@ -308,12 +308,18 @@

ProcessDefIntervalCall(inDef, inIntervalSecFloat)

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

-

ProcessIsStarted(inProcessNameWOExeStr)

+

ProcessGSettingsGet()

+

Return GSettings (singleton) from global variable

+ +

ProcessIsStarted(inProcessNameWOExeStr)

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

-

ProcessListGet([inProcessNameWOExeList])

+

ProcessListGet([inProcessNameWOExeList])

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

+

ProcessLoggerGet()

+

Return Logger from global variable

+

ProcessStart(inPathStr, inArgList[, …])

Start process locally.

@@ -750,6 +756,17 @@ +
+
+pyOpenRPA.Orchestrator.__Orchestrator__.ProcessGSettingsGet()[source]
+

Return GSettings (singleton) from global variable

+
+
Returns
+

+
+
+
+
pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted(inProcessNameWOExeStr)[source]
@@ -809,6 +826,17 @@
+
+
+pyOpenRPA.Orchestrator.__Orchestrator__.ProcessLoggerGet()[source]
+

Return Logger from global variable

+
+
Returns
+

+
+
+
+
pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStart(inPathStr, inArgList, inStopProcessNameWOExeStr=None)[source]
diff --git a/Wiki/ENG_Guide/html/_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html b/Wiki/ENG_Guide/html/_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html index efe01482..1e505abd 100644 --- a/Wiki/ENG_Guide/html/_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html +++ b/Wiki/ENG_Guide/html/_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html @@ -204,7 +204,7 @@ import datetime # datetime #Единый глобальный словарь (За основу взять из Settings.py) -global gSettingsDict +gSettingsDict = None # AGENT DEFS @@ -1123,6 +1123,26 @@ pass return lResult +
[docs]def ProcessGSettingsGet(): + """ + Return GSettings (singleton) from global variable + + :return: + """ + global gSettingsDict + return gSettingsDict
+ +
[docs]def ProcessLoggerGet(): + """ + Return Logger from global variable + + :return: + """ + global gSettingsDict + lResult = None + if "Logger" in gSettingsDict: lResult = gSettingsDict["Logger"] + return lResult
+
[docs]def ProcessDefIntervalCall(inDef, inIntervalSecFloat, inIntervalAsyncBool=False, inDefArgList=None, inDefArgDict=None, inExecuteInNewThreadBool=True, inLogger=None): """ Use this procedure if you need to run periodically some def. Set def, args, interval and enjoy :) @@ -1899,6 +1919,7 @@ else: # Code of your program here #mGlobalDict = Settings.Settings(sys.argv[1]) + global gSettingsDict gSettingsDict = inGSettings # Alias for old name in alg inGSettings["VersionStr"] = __version__ #Logger alias diff --git a/Wiki/ENG_Guide/html/genindex.html b/Wiki/ENG_Guide/html/genindex.html index 91585461..0ab5654a 100644 --- a/Wiki/ENG_Guide/html/genindex.html +++ b/Wiki/ENG_Guide/html/genindex.html @@ -278,10 +278,14 @@
    +
  • ProcessStop() (in module pyOpenRPA.Orchestrator.__Orchestrator__) +
  • ProcessWOExeUpperUserListGet() (in module pyOpenRPA.Agent.__Agent__)
  • PWASpecification_Get_PWAApplication() (in module pyOpenRPA.Robot.UIDesktop) diff --git a/Wiki/ENG_Guide/html/objects.inv b/Wiki/ENG_Guide/html/objects.inv index 90ba3b404981a973134fce9def62c0bc84193a30..df3c38cc9af254c1b6456948b9c2ba9a9f0e1e54 100644 GIT binary patch delta 1009 zcmVBY%H@Vw=njPoufO52}oFo&eJ% zVh8lmjr*3F7?r2OfO@2SOgVQ+RU4fvUn+T~Ii4+1N*Gri& z9i4|Ly?^H{!n4!{iZQ%f6!2 ziE+vHFpA?fzyo(vkgrDL^5)`h^N=G*@glaA4}TyW=0oIhh`xsV@!T!`YVo~Hf(YTB z#76Klut**|de5*t8q`#5q^sh-qRItxpPDTbmfzSjC>@O)VuNrQ7ssJ#6|;{(|h2rK!1N| zsMpFT=~}<0Hz)u6XLh@I+wj_j+ptyqH6dOaS04kKLZnz?kJsy}2u}mPKDDcGTm80B z-FHvJbqubLs+N#Sbi{OB*ccYQrwI;Y3f$}31~C{M;e86Rc0LW2iwl%bKCwdw#1`CS z6y=f89Ib3MZRVPX!vkSC)dtrZcqI2=r&kB&fB*hRlb`H?d3by3m~D~`DnS8qS0Y@%ig`Dr fuc#Go{B3QWC&sp7(O2jciIdFf7QFue;fhO}u}=Va delta 997 zcmVQJ^Q+i1741M9 zMU7NQ(QF>=XjAltjeQZgSkee*`Gb>00Z0PhDU*%?BY(exVw=njPoufO52}oFo&eJ% zVh8kx8}}_UF)B}m0ri9OG3DGP)l>&|=OA`T(p^jRN)b3a|C&H1F7c&ml`rlhX(yk< zlyu`rdwX5*OTUJ7PYtgASCU}~m}>E2OV% zv47Vks=^y7xeIu#TB#ET{H&5qh($;^VUg((KFpt``<`_8RYs}4W!oLczh38yCNkbJ z9@~s)ZN>iY89(gLiB2E~M)i%{uiI3RmFc{5+eyKx;=zkNE+YMq@`T<7J8RHvF$xgyo;-FER#%G zQ`h(@42_I#DR+)2fUbOUkdcq1l6qJEAgTp}kJxAcbNT@M73dEQ^;-EPUF!$v=6~d$ z|1xbCZyR2_a2vLYzb3>>X*Qa(BZmZvbs{8I~xQ@Z~QPmPs ziH?}A3me0t_cXy_Oo4k{+aLymBfL)`*3PG)a&dw3$tQN`fY^eYjG{a;+T&G{d!@Gw z!~CO(*OqjiM$6SYbi4My6kT<0$A2?ny}ylpC {…}] +### pyOpenRPA.Orchestrator.__Orchestrator__.ProcessLoggerGet() +Return Logger from global variable + + +* **Returns** + + + + ### pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStart(inPathStr, inArgList, inStopProcessNameWOExeStr=None) Start process locally. Extra feature: Use inStopProcessNameWOExeStr to stop the execution if current process is running.