Minor fixes in AgentReturnValue

# Set mark to wait return value after Orc init - else Exception
# Update guide
dev-linux
Ivan Maslov 4 years ago
parent e10f774e9d
commit e8a7f5ed5a

@ -2,4 +2,14 @@ import threading
# Check if current execution is in Processor thread
def IsProcessorThread(inGSettings):
return inGSettings["ProcessorDict"]["ThreadIdInt"] == threading.get_ident()
return inGSettings["ProcessorDict"]["ThreadIdInt"] == threading.get_ident()
def IsOrchestratorInitialized(inGSettings):
"""
Check if Orchestrator will be successfully initialized
:param inGSettings: global settings (singleton)
:return:
"""
# Check if gSettings has flag "HiddenOrchestratorInitBool"
return inGSettings.get("HiddenIsOrchestratorInitializedBool", False)

@ -272,6 +272,7 @@ def __Create__():
# Key - Activity Item GUID str, Value {"Return": ..., "ReturnedByDatetime": datetime.datetime}
# If key exists - def has been completed
}
# "HiddenIsOrchestratorInitialized" - will be inited when orchestrator will be initialized
}
# Create full configuration for

@ -72,16 +72,22 @@ def AgentActivityItemReturnGet(inGSettings, inGUIDStr, inCheckIntervalSecFloat =
"""
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.
:param inGSettings: Global settings dict (singleton)
:param inGUIDStr: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
:param inCheckIntervalSecFloat: Interval in sec of the check Activity Item result
:return: Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!
"""
# Wait while result will not come here
while not AgentActivityItemReturnExists(inGSettings=inGSettings, inGUIDStr=inGUIDStr):
time.sleep(inCheckIntervalSecFloat)
# Return the result
return inGSettings["AgentActivityReturnDict"][inGUIDStr]
#Check if Orchestrator has been initialized - else raise exception
if Core.IsOrchestratorInitialized(inGSettings=inGSettings) == True:
# Wait while result will not come here
while not AgentActivityItemReturnExists(inGSettings=inGSettings, inGUIDStr=inGUIDStr):
time.sleep(inCheckIntervalSecFloat)
# Return the result
return inGSettings["AgentActivityReturnDict"][inGUIDStr]["Return"]
else:
raise Exception(f"__Orchestrator__.AgentActivityItemReturnGet !ATTENTION! Use this function only after Orchestrator initialization! Before orchestrator init exception will be raised.")
def AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=True, inSendOutputToOrchestratorLogsBool=True, inCMDEncodingStr="cp1251"):
"""
@ -273,12 +279,21 @@ def UACKeyListCheck(inRequest, inRoleKeyList) -> bool:
"""
Check is client is has access for the key list
:param inRequest:
:param inRequest: request handler (from http.server import BaseHTTPRequestHandler)
:param inRoleKeyList:
:return: bool
"""
return inRequest.UACClientCheck(inRoleKeyList=inRoleKeyList)
def UACUserDictGet(inRequest) -> dict:
"""
Return user UAC hierarchy dict of the inRequest object. Empty dict - superuser access
:param inRequest: request handler (from http.server import BaseHTTPRequestHandler)
:return: user UAC hierarchy dict
"""
return inRequest.UserRoleHierarchyGet() # get the Hierarchy
def UACUpdate(inGSettings, inADLoginStr, inADStr="", inADIsDefaultBool=True, inURLList=None, inRoleHierarchyAllowedDict=None):
"""
Update user access (UAC)
@ -1853,6 +1868,10 @@ def Orchestrator(inGSettings):
if lL: lL.info("Scheduler loop start") #Logging
gDaemonActivityLogDictRefreshSecInt = 10 # The second period for clear lDaemonActivityLogDict from old items
gDaemonActivityLogDictLastTime = time.time() # The second perioad for clean lDaemonActivityLogDict from old items
# Set flag that orchestrator has been initialized
inGSettings["HiddenIsOrchestratorInitializedBool"] = True
while True:
try:
lCurrentDateTime = datetime.datetime.now()

@ -386,25 +386,28 @@
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.UACUpdate" title="pyOpenRPA.Orchestrator.__Orchestrator__.UACUpdate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">UACUpdate</span></code></a>(inGSettings, inADLoginStr[, …])</p></td>
<td><p>Update user access (UAC)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebCPUpdate" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebCPUpdate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebCPUpdate</span></code></a>(inGSettings, inCPKeyStr[, …])</p></td>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.UACUserDictGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.UACUserDictGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">UACUserDictGet</span></code></a>(inRequest)</p></td>
<td><p>Return user UAC hierarchy dict of the inRequest object.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebCPUpdate" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebCPUpdate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebCPUpdate</span></code></a>(inGSettings, inCPKeyStr[, …])</p></td>
<td><p>Add control panel HTML, JSON generator or JS when page init</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebURLConnectDef</span></code></a>(inGSettings, inMethodStr, …)</p></td>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectDef"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebURLConnectDef</span></code></a>(inGSettings, inMethodStr, …)</p></td>
<td><p>Connect URL to DEF</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFile" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFile"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebURLConnectFile</span></code></a>(inGSettings, inMethodStr, …)</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFile" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFile"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebURLConnectFile</span></code></a>(inGSettings, inMethodStr, …)</p></td>
<td><p>Connect URL to File</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFolder" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFolder"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebURLConnectFolder</span></code></a>(inGSettings, …)</p></td>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFolder" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebURLConnectFolder"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebURLConnectFolder</span></code></a>(inGSettings, …)</p></td>
<td><p>Connect URL to Folder</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebUserInfoGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebUserInfoGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebUserInfoGet</span></code></a>(inRequest)</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebUserInfoGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebUserInfoGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebUserInfoGet</span></code></a>(inRequest)</p></td>
<td><p>Return User info about request</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebUserIsSuperToken" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebUserIsSuperToken"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebUserIsSuperToken</span></code></a>(inRequest, inGSettings)</p></td>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebUserIsSuperToken" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebUserIsSuperToken"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebUserIsSuperToken</span></code></a>(inRequest, inGSettings)</p></td>
<td><p>Return bool if request is authentificated with supetoken (token which is never expires)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebUserUACHierarchyGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebUserUACHierarchyGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebUserUACHierarchyGet</span></code></a>(inRequest)</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebUserUACHierarchyGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.WebUserUACHierarchyGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">WebUserUACHierarchyGet</span></code></a>(inRequest)</p></td>
<td><p>Return User UAC Hierarchy DICT Return {…}</p></td>
</tr>
</tbody>
@ -449,6 +452,7 @@
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">AgentActivityItemReturnGet</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inGSettings</span></em>, <em class="sig-param"><span class="n">inGUIDStr</span></em>, <em class="sig-param"><span class="n">inCheckIntervalSecFloat</span><span class="o">=</span><span class="default_value">0.5</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#AgentActivityItemReturnGet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet" title="Permalink to this definition"></a></dt>
<dd><p>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</p>
<p>!ATTENTION! Use only after Orchestrator initialization! Before orchestrator init exception will be raised.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
@ -1550,7 +1554,7 @@ Var 2 (Backward compatibility): inGSettings, inRDPSessionKeyStr, inHostStr, inPo
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>inRequest</strong> </p></li>
<li><p><strong>inRequest</strong> request handler (from http.server import BaseHTTPRequestHandler)</p></li>
<li><p><strong>inRoleKeyList</strong> </p></li>
</ul>
</dd>
@ -1592,6 +1596,20 @@ Var 2 (Backward compatibility): inGSettings, inRDPSessionKeyStr, inHostStr, inPo
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.UACUserDictGet">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">UACUserDictGet</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inRequest</span></em><span class="sig-paren">)</span> &#x2192; dict<a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#UACUserDictGet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.UACUserDictGet" title="Permalink to this definition"></a></dt>
<dd><p>Return user UAC hierarchy dict of the inRequest object. Empty dict - superuser access</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>inRequest</strong> request handler (from http.server import BaseHTTPRequestHandler)</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>user UAC hierarchy dict</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.WebCPUpdate">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">WebCPUpdate</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inGSettings</span></em>, <em class="sig-param"><span class="n">inCPKeyStr</span></em>, <em class="sig-param"><span class="n">inHTMLRenderDef</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">inJSONGeneratorDef</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">inJSInitGeneratorDef</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#WebCPUpdate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.WebCPUpdate" title="Permalink to this definition"></a></dt>

@ -447,7 +447,7 @@
<span class="p">}</span>
<span class="p">},</span>
<span class="s2">&quot;Logger&quot;</span><span class="p">:</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;Orchestrator&quot;</span><span class="p">),</span>
<span class="s2">&quot;Storage&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;StorageDict&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;Robot_R01_help&quot;</span><span class="p">:</span> <span class="s2">&quot;Robot data storage in orchestrator env&quot;</span><span class="p">,</span>
<span class="s2">&quot;Robot_R01&quot;</span><span class="p">:</span> <span class="p">{},</span>
<span class="s2">&quot;R01_OrchestratorToRobot&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;Test2&quot;</span><span class="p">:</span> <span class="s2">&quot;Test2&quot;</span><span class="p">}</span>
@ -459,6 +459,7 @@
<span class="c1"># Key - Activity Item GUID str, Value {&quot;Return&quot;: ..., &quot;ReturnedByDatetime&quot;: datetime.datetime}</span>
<span class="c1"># If key exists - def has been completed</span>
<span class="p">}</span>
<span class="c1"># &quot;HiddenIsOrchestratorInitialized&quot; - will be inited when orchestrator will be initialized</span>
<span class="p">}</span>
<span class="c1"># Create full configuration for</span>

@ -185,6 +185,7 @@
<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">Processor</span>
<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">BackwardCompatibility</span> <span class="c1"># Backward compatibility from v1.1.13</span>
<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">Core</span>
<span class="kn">from</span> <span class="nn">subprocess</span> <span class="kn">import</span> <span class="n">CREATE_NEW_CONSOLE</span>
<span class="kn">from</span> <span class="nn">.Utils</span> <span class="kn">import</span> <span class="n">LoggerHandlerDumpLogList</span>
<span class="c1"># ATTENTION! HERE IS NO Relative import because it will be imported dynamically</span>
@ -252,16 +253,22 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> 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</span>
<span class="sd"> !ATTENTION! Use only after Orchestrator initialization! Before orchestrator init exception will be raised.</span>
<span class="sd"> :param inGSettings: Global settings dict (singleton)</span>
<span class="sd"> :param inGUIDStr: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<span class="sd"> :param inCheckIntervalSecFloat: Interval in sec of the check Activity Item result</span>
<span class="sd"> :return: Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Wait while result will not come here</span>
<span class="k">while</span> <span class="ow">not</span> <span class="n">AgentActivityItemReturnExists</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inGUIDStr</span><span class="o">=</span><span class="n">inGUIDStr</span><span class="p">):</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">inCheckIntervalSecFloat</span><span class="p">)</span>
<span class="c1"># Return the result</span>
<span class="k">return</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentActivityReturnDict&quot;</span><span class="p">][</span><span class="n">inGUIDStr</span><span class="p">]</span></div>
<span class="c1">#Check if Orchestrator has been initialized - else raise exception</span>
<span class="k">if</span> <span class="n">Core</span><span class="o">.</span><span class="n">IsOrchestratorInitialized</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">)</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span>
<span class="c1"># Wait while result will not come here</span>
<span class="k">while</span> <span class="ow">not</span> <span class="n">AgentActivityItemReturnExists</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inGUIDStr</span><span class="o">=</span><span class="n">inGUIDStr</span><span class="p">):</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">inCheckIntervalSecFloat</span><span class="p">)</span>
<span class="c1"># Return the result</span>
<span class="k">return</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentActivityReturnDict&quot;</span><span class="p">][</span><span class="n">inGUIDStr</span><span class="p">][</span><span class="s2">&quot;Return&quot;</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;__Orchestrator__.AgentActivityItemReturnGet !ATTENTION! Use this function only after Orchestrator initialization! Before orchestrator init exception will be raised.&quot;</span><span class="p">)</span></div>
<div class="viewcode-block" id="AgentOSCMD"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD">[docs]</a><span class="k">def</span> <span class="nf">AgentOSCMD</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inCMDStr</span><span class="p">,</span> <span class="n">inRunAsyncBool</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inSendOutputToOrchestratorLogsBool</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inCMDEncodingStr</span><span class="o">=</span><span class="s2">&quot;cp1251&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -391,7 +398,7 @@
<span class="k">def</span> <span class="nf">_CMDRunAndListenLogs</span><span class="p">(</span><span class="n">inCMDStr</span><span class="p">,</span> <span class="n">inLogger</span><span class="p">):</span>
<span class="n">lResultStr</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">lOSCMDKeyStr</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="o">.</span><span class="n">uuid4</span><span class="p">())[</span><span class="mi">0</span><span class="p">:</span><span class="mi">4</span><span class="p">]</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span>
<span class="n">lCMDProcess</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;cmd /c </span><span class="si">{</span><span class="n">inCMDStr</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">STDOUT</span><span class="p">)</span>
<span class="n">lCMDProcess</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;cmd /c </span><span class="si">{</span><span class="n">inCMDStr</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">STDOUT</span><span class="p">,</span> <span class="n">creationflags</span><span class="o">=</span><span class="n">CREATE_NEW_CONSOLE</span><span class="p">)</span>
<span class="k">if</span> <span class="n">inLogger</span><span class="p">:</span>
<span class="n">lListenBool</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">inLogger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">lOSCMDKeyStr</span><span class="si">}</span><span class="s2">: # # # # CMD Process has been STARTED # # # # &quot;</span><span class="p">)</span>
@ -453,12 +460,21 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Check is client is has access for the key list</span>
<span class="sd"> :param inRequest:</span>
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
<span class="sd"> :param inRoleKeyList:</span>
<span class="sd"> :return: bool</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">inRequest</span><span class="o">.</span><span class="n">UACClientCheck</span><span class="p">(</span><span class="n">inRoleKeyList</span><span class="o">=</span><span class="n">inRoleKeyList</span><span class="p">)</span></div>
<div class="viewcode-block" id="UACUserDictGet"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.UACUserDictGet">[docs]</a><span class="k">def</span> <span class="nf">UACUserDictGet</span><span class="p">(</span><span class="n">inRequest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">dict</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return user UAC hierarchy dict of the inRequest object. Empty dict - superuser access</span>
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
<span class="sd"> :return: user UAC hierarchy dict</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">inRequest</span><span class="o">.</span><span class="n">UserRoleHierarchyGet</span><span class="p">()</span> <span class="c1"># get the Hierarchy</span></div>
<div class="viewcode-block" id="UACUpdate"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.UACUpdate">[docs]</a><span class="k">def</span> <span class="nf">UACUpdate</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inADLoginStr</span><span class="p">,</span> <span class="n">inADStr</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">inADIsDefaultBool</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inURLList</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inRoleHierarchyAllowedDict</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Update user access (UAC)</span>
@ -1193,7 +1209,8 @@
<span class="n">lThread</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="n">__Execute__</span><span class="p">,</span>
<span class="n">kwargs</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;inGSettings&quot;</span><span class="p">:</span><span class="n">inGSettings</span><span class="p">,</span> <span class="s2">&quot;inDef&quot;</span><span class="p">:</span> <span class="n">inDef</span><span class="p">,</span> <span class="s2">&quot;inIntervalSecFloat&quot;</span><span class="p">:</span> <span class="n">inIntervalSecFloat</span><span class="p">,</span>
<span class="s2">&quot;inIntervalAsyncBool&quot;</span><span class="p">:</span> <span class="n">inIntervalAsyncBool</span><span class="p">,</span> <span class="s2">&quot;inDefArgList&quot;</span><span class="p">:</span> <span class="n">inDefArgList</span><span class="p">,</span>
<span class="s2">&quot;inDefArgDict&quot;</span><span class="p">:</span> <span class="n">inDefArgDict</span><span class="p">,</span> <span class="s2">&quot;inLogger&quot;</span><span class="p">:</span> <span class="n">inLogger</span><span class="p">})</span>
<span class="s2">&quot;inDefArgDict&quot;</span><span class="p">:</span> <span class="n">inDefArgDict</span><span class="p">,</span> <span class="s2">&quot;inLogger&quot;</span><span class="p">:</span> <span class="n">inLogger</span><span class="p">,</span>
<span class="s2">&quot;inDefArgGSettingsNameStr&quot;</span><span class="p">:</span><span class="n">inDefArgGSettingsNameStr</span> <span class="p">,</span> <span class="s2">&quot;inDefArgLoggerNameStr&quot;</span><span class="p">:</span><span class="n">inDefArgLoggerNameStr</span><span class="p">})</span>
<span class="n">lThread</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">__Execute__</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inDef</span><span class="o">=</span><span class="n">inDef</span><span class="p">,</span> <span class="n">inIntervalSecFloat</span><span class="o">=</span><span class="n">inIntervalSecFloat</span><span class="p">,</span> <span class="n">inIntervalAsyncBool</span><span class="o">=</span><span class="n">inIntervalAsyncBool</span><span class="p">,</span>
@ -2032,6 +2049,10 @@
<span class="k">if</span> <span class="n">lL</span><span class="p">:</span> <span class="n">lL</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Scheduler loop start&quot;</span><span class="p">)</span> <span class="c1">#Logging</span>
<span class="n">gDaemonActivityLogDictRefreshSecInt</span> <span class="o">=</span> <span class="mi">10</span> <span class="c1"># The second period for clear lDaemonActivityLogDict from old items</span>
<span class="n">gDaemonActivityLogDictLastTime</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="c1"># The second perioad for clean lDaemonActivityLogDict from old items</span>
<span class="c1"># Set flag that orchestrator has been initialized</span>
<span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;HiddenIsOrchestratorInitializedBool&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">lCurrentDateTime</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>

@ -379,6 +379,8 @@
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.UACSuperTokenUpdate">UACSuperTokenUpdate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.UACUpdate">UACUpdate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.UACUserDictGet">UACUserDictGet() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Robot/02_Defs.html#pyOpenRPA.Robot.UIDesktop.UIOSelector_Exist_Bool">UIOSelector_Exist_Bool() (in module pyOpenRPA.Robot.UIDesktop)</a>
</li>
@ -393,11 +395,11 @@
<li><a href="Robot/02_Defs.html#pyOpenRPA.Robot.UIDesktop.UIOSelector_Get_UIOActivityList">UIOSelector_Get_UIOActivityList() (in module pyOpenRPA.Robot.UIDesktop)</a>
</li>
<li><a href="Robot/02_Defs.html#pyOpenRPA.Robot.UIDesktop.UIOSelector_Get_UIOInfo">UIOSelector_Get_UIOInfo() (in module pyOpenRPA.Robot.UIDesktop)</a>
</li>
<li><a href="Robot/02_Defs.html#pyOpenRPA.Robot.UIDesktop.UIOSelector_Get_UIOList">UIOSelector_Get_UIOList() (in module pyOpenRPA.Robot.UIDesktop)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="Robot/02_Defs.html#pyOpenRPA.Robot.UIDesktop.UIOSelector_Get_UIOList">UIOSelector_Get_UIOList() (in module pyOpenRPA.Robot.UIDesktop)</a>
</li>
<li><a href="Robot/02_Defs.html#pyOpenRPA.Robot.UIDesktop.UIOSelector_GetChildList_UIOList">UIOSelector_GetChildList_UIOList() (in module pyOpenRPA.Robot.UIDesktop)</a>
</li>
<li><a href="Robot/02_Defs.html#pyOpenRPA.Robot.UIDesktop.UIOSelector_Highlight">UIOSelector_Highlight() (in module pyOpenRPA.Robot.UIDesktop)</a>

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -269,6 +269,11 @@ Work with activity scheduling.
| Update user access (UAC)
|
| `UACUserDictGet`(inRequest)
| Return user UAC hierarchy dict of the inRequest object.
|
| `WebCPUpdate`(inGSettings, inCPKeyStr[, …])
| Add control panel HTML, JSON generator or JS when page init
@ -354,6 +359,8 @@ Check by GUID if ActivityItem has been executed and result has come to the Orche
### pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet(inGSettings, inGUIDStr, inCheckIntervalSecFloat=0.5)
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**
@ -1720,7 +1727,7 @@ Check is client is has access for the key list
* **Parameters**
* **inRequest**
* **inRequest** request handler (from http.server import BaseHTTPRequestHandler)
* **inRoleKeyList**
@ -1773,6 +1780,22 @@ Update user access (UAC)
### pyOpenRPA.Orchestrator.__Orchestrator__.UACUserDictGet(inRequest)
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__.WebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None)
Add control panel HTML, JSON generator or JS when page init

@ -265,7 +265,7 @@ def __Create__():
}
},
"Logger": logging.getLogger("Orchestrator"),
"Storage": {
"StorageDict": {
"Robot_R01_help": "Robot data storage in orchestrator env",
"Robot_R01": {},
"R01_OrchestratorToRobot": {"Test2": "Test2"}
@ -277,6 +277,7 @@ def __Create__():
# Key - Activity Item GUID str, Value {"Return": ..., "ReturnedByDatetime": datetime.datetime}
# If key exists - def has been completed
}
# "HiddenIsOrchestratorInitialized" - will be inited when orchestrator will be initialized
}
# Create full configuration for

Loading…
Cancel
Save