Add Orchestrator ProcessGSettingsget and ProcessLoggerGet

dev-linux
Ivan Maslov 4 years ago
parent f1b0472fce
commit 1df423c09f

@ -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

@ -308,12 +308,18 @@
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessDefIntervalCall" title="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessDefIntervalCall"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProcessDefIntervalCall</span></code></a>(inDef, inIntervalSecFloat)</p></td>
<td><p>Use this procedure if you need to run periodically some def.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted" title="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProcessIsStarted</span></code></a>(inProcessNameWOExeStr)</p></td>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessGSettingsGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessGSettingsGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProcessGSettingsGet</span></code></a>()</p></td>
<td><p>Return GSettings (singleton) from global variable</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted" title="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProcessIsStarted</span></code></a>(inProcessNameWOExeStr)</p></td>
<td><p>Check if there is any running process that contains the given name processName.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessListGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessListGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProcessListGet</span></code></a>([inProcessNameWOExeList])</p></td>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessListGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessListGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProcessListGet</span></code></a>([inProcessNameWOExeList])</p></td>
<td><p>Return process list on the orchestrator machine sorted by Memory Usage.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessLoggerGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessLoggerGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProcessLoggerGet</span></code></a>()</p></td>
<td><p>Return Logger from global variable</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStart" title="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStart"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProcessStart</span></code></a>(inPathStr, inArgList[, …])</p></td>
<td><p>Start process locally.</p></td>
</tr>
@ -750,6 +756,17 @@
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessGSettingsGet">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">ProcessGSettingsGet</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#ProcessGSettingsGet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessGSettingsGet" title="Permalink to this definition"></a></dt>
<dd><p>Return GSettings (singleton) from global variable</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">ProcessIsStarted</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inProcessNameWOExeStr</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#ProcessIsStarted"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted" title="Permalink to this definition"></a></dt>
@ -809,6 +826,17 @@
</div></blockquote>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessLoggerGet">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">ProcessLoggerGet</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#ProcessLoggerGet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessLoggerGet" title="Permalink to this definition"></a></dt>
<dd><p>Return Logger from global variable</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStart">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">ProcessStart</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inPathStr</span></em>, <em class="sig-param"><span class="n">inArgList</span></em>, <em class="sig-param"><span class="n">inStopProcessNameWOExeStr</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#ProcessStart"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStart" title="Permalink to this definition"></a></dt>

@ -204,7 +204,7 @@
<span class="kn">import</span> <span class="nn">datetime</span> <span class="c1"># datetime</span>
<span class="c1">#Единый глобальный словарь (За основу взять из Settings.py)</span>
<span class="k">global</span> <span class="n">gSettingsDict</span>
<span class="n">gSettingsDict</span> <span class="o">=</span> <span class="kc">None</span>
<span class="c1"># AGENT DEFS</span>
@ -1123,6 +1123,26 @@
<span class="k">pass</span>
<span class="k">return</span> <span class="n">lResult</span></div>
<div class="viewcode-block" id="ProcessGSettingsGet"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessGSettingsGet">[docs]</a><span class="k">def</span> <span class="nf">ProcessGSettingsGet</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return GSettings (singleton) from global variable</span>
<span class="sd"> :return:</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">global</span> <span class="n">gSettingsDict</span>
<span class="k">return</span> <span class="n">gSettingsDict</span></div>
<div class="viewcode-block" id="ProcessLoggerGet"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessLoggerGet">[docs]</a><span class="k">def</span> <span class="nf">ProcessLoggerGet</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return Logger from global variable</span>
<span class="sd"> :return:</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">global</span> <span class="n">gSettingsDict</span>
<span class="n">lResult</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="s2">&quot;Logger&quot;</span> <span class="ow">in</span> <span class="n">gSettingsDict</span><span class="p">:</span> <span class="n">lResult</span> <span class="o">=</span> <span class="n">gSettingsDict</span><span class="p">[</span><span class="s2">&quot;Logger&quot;</span><span class="p">]</span>
<span class="k">return</span> <span class="n">lResult</span></div>
<div class="viewcode-block" id="ProcessDefIntervalCall"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessDefIntervalCall">[docs]</a><span class="k">def</span> <span class="nf">ProcessDefIntervalCall</span><span class="p">(</span><span class="n">inDef</span><span class="p">,</span> <span class="n">inIntervalSecFloat</span><span class="p">,</span> <span class="n">inIntervalAsyncBool</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">inDefArgList</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inDefArgDict</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inExecuteInNewThreadBool</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inLogger</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Use this procedure if you need to run periodically some def. Set def, args, interval and enjoy :)</span>
@ -1899,6 +1919,7 @@
<span class="k">else</span><span class="p">:</span>
<span class="c1"># Code of your program here</span>
<span class="c1">#mGlobalDict = Settings.Settings(sys.argv[1])</span>
<span class="k">global</span> <span class="n">gSettingsDict</span>
<span class="n">gSettingsDict</span> <span class="o">=</span> <span class="n">inGSettings</span> <span class="c1"># Alias for old name in alg</span>
<span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;VersionStr&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">__version__</span>
<span class="c1">#Logger alias</span>

@ -278,10 +278,14 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessDefIntervalCall">ProcessDefIntervalCall() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessGSettingsGet">ProcessGSettingsGet() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted">ProcessIsStarted() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessListGet">ProcessListGet() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessLoggerGet">ProcessLoggerGet() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessorActivityItemAppend">ProcessorActivityItemAppend() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
@ -292,11 +296,11 @@
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessorAliasDefUpdate">ProcessorAliasDefUpdate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStart">ProcessStart() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStop">ProcessStop() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.ProcessStop">ProcessStop() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Agent/02_Defs.html#pyOpenRPA.Agent.__Agent__.ProcessWOExeUpperUserListGet">ProcessWOExeUpperUserListGet() (in module pyOpenRPA.Agent.__Agent__)</a>
</li>
<li><a href="Robot/02_Defs.html#pyOpenRPA.Robot.UIDesktop.PWASpecification_Get_PWAApplication">PWASpecification_Get_PWAApplication() (in module pyOpenRPA.Robot.UIDesktop)</a>

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -139,6 +139,11 @@ Work with activity scheduling.
| Use this procedure if you need to run periodically some def.
|
| `ProcessGSettingsGet`()
| Return GSettings (singleton) from global variable
|
| `ProcessIsStarted`(inProcessNameWOExeStr)
| Check if there is any running process that contains the given name processName.
@ -149,6 +154,11 @@ Work with activity scheduling.
| Return process list on the orchestrator machine sorted by Memory Usage.
|
| `ProcessLoggerGet`()
| Return Logger from global variable
|
| `ProcessStart`(inPathStr, inArgList[, …])
| Start process locally.
@ -746,6 +756,15 @@ Use this procedure if you need to run periodically some def. Set def, args, inte
### pyOpenRPA.Orchestrator.__Orchestrator__.ProcessGSettingsGet()
Return GSettings (singleton) from global variable
* **Returns**
### pyOpenRPA.Orchestrator.__Orchestrator__.ProcessIsStarted(inProcessNameWOExeStr)
Check if there is any running process that contains the given name processName.
@ -811,6 +830,15 @@ lProcessList = Orchestrator.ProcessListGet()
> {…}]
### 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.

Loading…
Cancel
Save