dev-linux
Ivan Maslov 4 years ago
parent baf928ded2
commit f9b3c89fb4

@ -13,6 +13,9 @@ If you need to give some little rights for user only for one robot in orchestrat
To work with UAC you can use defs ``Orchestrator.UAC`` group.
!!!ATTENTION!!!
Need practice example to work with UAC! - too hard to understand
***************************************************
UAC Dict for Orchestrator WEB UI rights

@ -7,6 +7,7 @@ Here you can find the functions description for interaction with desktop GUI app
How to use both x32 and x64 python processes (it can be helpfully, if another app GUI is on another bitness than your app)
.. code-block:: python
from pyOpenRPA.Robot import UIDesktop
#Section for robot init
lPyOpenRPA_SettingsDict = {
@ -19,6 +20,7 @@ How to use both x32 and x64 python processes (it can be helpfully, if another ap
UIDesktop.Utils.ProcessBitness.SettingsInit(lPyOpenRPA_SettingsDict)
# Now you can use pyOpenRPA with both bitness.
.. automodule:: pyOpenRPA.Robot.UIDesktop
:members:
:autosummary:

@ -417,16 +417,18 @@
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">AgentOSCMD</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inGSettings</span></em>, <em class="sig-param"><span class="n">inHostNameStr</span></em>, <em class="sig-param"><span class="n">inUserStr</span></em>, <em class="sig-param"><span class="n">inCMDStr</span></em>, <em class="sig-param"><span class="n">inRunAsyncBool</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#AgentOSCMD"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD" title="Permalink to this definition"></a></dt>
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">AgentOSCMD</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inGSettings</span></em>, <em class="sig-param"><span class="n">inHostNameStr</span></em>, <em class="sig-param"><span class="n">inUserStr</span></em>, <em class="sig-param"><span class="n">inCMDStr</span></em>, <em class="sig-param"><span class="n">inRunAsyncBool</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">inSendOutputToOrchestratorLogsBool</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">inCMDEncodingStr</span><span class="o">=</span><span class="default_value">'cp1251'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#AgentOSCMD"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD" title="Permalink to this definition"></a></dt>
<dd><p>Send CMD to OS thought the pyOpenRPA.Agent daemon. Result return to log + Orchestrator by the A2O connection</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>inGSettings</strong> Global settings dict (singleton)</p></li>
<li><p><strong>inHostNameStr</strong> </p></li>
<li><p><strong>inUserStr</strong> </p></li>
<li><p><strong>inCMDStr</strong> </p></li>
<li><p><strong>inRunAsyncBool</strong> </p></li>
<li><p><strong>inHostNameStr</strong> 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</p></li>
<li><p><strong>inUserStr</strong> Agent user name in upper case (example “UserRPA”). Active agent session you can see on the orchestrator dashboard as Orchestrator admin</p></li>
<li><p><strong>inCMDStr</strong> command to execute on the Agent session</p></li>
<li><p><strong>inRunAsyncBool</strong> True - Agent processor dont wait execution; False - Agent processor wait cmd execution</p></li>
<li><p><strong>inSendOutputToOrchestratorLogsBool</strong> True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True</p></li>
<li><p><strong>inCMDEncodingStr</strong> Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is “cp1251” early was “cp866” - need test</p></li>
</ul>
</dd>
</dl>

@ -189,6 +189,8 @@
<p>If you need to give admin rights - you dont customize UAC dict.</p>
<p>If you need to give some little rights for user only for one robot in orchestrator web panel - you can set the following properties in UAC dict.</p>
<p>To work with UAC you can use defs <code class="docutils literal notranslate"><span class="pre">Orchestrator.UAC</span></code> group.</p>
<p>!!!ATTENTION!!!</p>
<p>Need practice example to work with UAC! - too hard to understand</p>
</div>
<div class="section" id="uac-dict-for-orchestrator-web-ui-rights">
<h2>UAC Dict for Orchestrator WEB UI rights<a class="headerlink" href="#uac-dict-for-orchestrator-web-ui-rights" title="Permalink to this headline"></a></h2>

@ -184,6 +184,20 @@
<div class="section" id="defs">
<h1>2. Defs<a class="headerlink" href="#defs" title="Permalink to this headline"></a></h1>
<p>Here you can find the functions description for interaction with desktop GUI applications</p>
<p>How to use both x32 and x64 python processes (it can be helpfully, if another app GUI is on another bitness than your app)</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">pyOpenRPA.Robot</span> <span class="kn">import</span> <span class="n">UIDesktop</span>
<span class="c1">#Section for robot init</span>
<span class="n">lPyOpenRPA_SettingsDict</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;Python32FullPath&quot;</span><span class="p">:</span> <span class="s2">&quot;..</span><span class="se">\\</span><span class="s2">Resources</span><span class="se">\\</span><span class="s2">WPy32-3720</span><span class="se">\\</span><span class="s2">python-3.7.2</span><span class="se">\\</span><span class="s2">python.exe&quot;</span><span class="p">,</span> <span class="c1">#Set from user: &quot;..\\Resources\\WPy32-3720\\python-3.7.2\\OpenRPARobotGUIx32.exe&quot;</span>
<span class="s2">&quot;Python64FullPath&quot;</span><span class="p">:</span> <span class="s2">&quot;..</span><span class="se">\\</span><span class="s2">Resources</span><span class="se">\\</span><span class="s2">WPy64-3720</span><span class="se">\\</span><span class="s2">python-3.7.2.amd64</span><span class="se">\\</span><span class="s2">python.exe&quot;</span><span class="p">,</span> <span class="c1">#Set from user</span>
<span class="s2">&quot;Python32ProcessName&quot;</span><span class="p">:</span> <span class="s2">&quot;pyOpenRPA_UIDesktopX32.exe&quot;</span><span class="p">,</span> <span class="c1">#Config set once</span>
<span class="s2">&quot;Python64ProcessName&quot;</span><span class="p">:</span> <span class="s2">&quot;pyOpenRPA_UIDesktopX64.exe&quot;</span> <span class="c1">#Config set once</span>
<span class="p">}</span>
<span class="c1"># Init the pyOpenRPA configuration</span>
<span class="n">UIDesktop</span><span class="o">.</span><span class="n">Utils</span><span class="o">.</span><span class="n">ProcessBitness</span><span class="o">.</span><span class="n">SettingsInit</span><span class="p">(</span><span class="n">lPyOpenRPA_SettingsDict</span><span class="p">)</span>
<span class="c1"># Now you can use pyOpenRPA with both bitness.</span>
</pre></div>
</div>
<span class="target" id="module-pyOpenRPA.Robot.UIDesktop"></span><p><strong>Functions:</strong></p>
<table class="longtable docutils align-default">
<colgroup>

@ -175,7 +175,7 @@
<div itemprop="articleBody">
<h1>Source code for pyOpenRPA.Orchestrator.__Orchestrator__</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">subprocess</span><span class="o">,</span> <span class="nn">json</span><span class="o">,</span> <span class="nn">psutil</span><span class="o">,</span> <span class="nn">time</span><span class="o">,</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">win32security</span><span class="o">,</span> <span class="nn">sys</span><span class="o">,</span> <span class="nn">base64</span><span class="o">,</span> <span class="nn">logging</span><span class="o">,</span> <span class="nn">ctypes</span> <span class="c1">#Get input argument</span>
<span></span><span class="kn">import</span> <span class="nn">subprocess</span><span class="o">,</span> <span class="nn">json</span><span class="o">,</span> <span class="nn">psutil</span><span class="o">,</span> <span class="nn">time</span><span class="o">,</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">win32security</span><span class="o">,</span> <span class="nn">sys</span><span class="o">,</span> <span class="nn">base64</span><span class="o">,</span> <span class="nn">logging</span><span class="o">,</span> <span class="nn">ctypes</span><span class="o">,</span> <span class="nn">copy</span> <span class="c1">#Get input argument</span>
<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">Server</span>
<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">Timer</span>
<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">Processor</span>
@ -214,27 +214,39 @@
<span class="sd"> :param inActivityItemDict: ActivityItem</span>
<span class="sd"> :return: None</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">inActivityItemDict</span><span class="p">)</span>
<span class="c1"># Add GUIDStr if not exist</span>
<span class="k">if</span> <span class="s2">&quot;GUIDStr&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">lActivityItemDict</span><span class="p">:</span>
<span class="n">lGUIDStr</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="c1"># generate new GUID</span>
<span class="n">lActivityItemDict</span><span class="p">[</span><span class="s2">&quot;GUIDStr&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">lGUIDStr</span>
<span class="c1"># Add CreatedByDatetime</span>
<span class="n">lActivityItemDict</span><span class="p">[</span><span class="s2">&quot;CreatedByDatetime&quot;</span><span class="p">]</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>
<span class="c1"># Main alg</span>
<span class="n">lAgentDictItemKeyTurple</span> <span class="o">=</span> <span class="p">(</span><span class="n">inHostNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span><span class="n">inUserStr</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span>
<span class="k">if</span> <span class="n">lAgentDictItemKeyTurple</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">]:</span>
<span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">][</span><span class="n">lAgentDictItemKeyTurple</span><span class="p">]</span> <span class="o">=</span> <span class="n">SettingsTemplate</span><span class="o">.</span><span class="n">__AgentDictItemCreate__</span><span class="p">()</span>
<span class="n">lThisAgentDict</span> <span class="o">=</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">][</span><span class="n">lAgentDictItemKeyTurple</span><span class="p">]</span>
<span class="n">lThisAgentDict</span><span class="p">[</span><span class="s2">&quot;ActivityList&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">inActivityItemDict</span><span class="p">)</span></div>
<span class="n">lThisAgentDict</span><span class="p">[</span><span class="s2">&quot;ActivityList&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">lActivityItemDict</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>
<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>
<span class="sd"> Send CMD to OS thought the pyOpenRPA.Agent daemon. Result return to log + Orchestrator by the A2O connection</span>
<span class="sd"> :param inGSettings: Global settings dict (singleton)</span>
<span class="sd"> :param inHostNameStr:</span>
<span class="sd"> :param inUserStr:</span>
<span class="sd"> :param inCMDStr:</span>
<span class="sd"> :param inRunAsyncBool:</span>
<span class="sd"> :param inHostNameStr: Agent host name in upper case (example &quot;RPA01&quot;, &quot;RPA_99&quot; and so on). Active agent session you can see on the orchestrator dashboard as Orchestrator admin</span>
<span class="sd"> :param inUserStr: Agent user name in upper case (example &quot;UserRPA&quot;). Active agent session you can see on the orchestrator dashboard as Orchestrator admin</span>
<span class="sd"> :param inCMDStr: command to execute on the Agent session</span>
<span class="sd"> :param inRunAsyncBool: True - Agent processor don&#39;t wait execution; False - Agent processor wait cmd execution</span>
<span class="sd"> :param inSendOutputToOrchestratorLogsBool: True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True</span>
<span class="sd"> :param inCMDEncodingStr: Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is &quot;cp1251&quot; early was &quot;cp866&quot; - need test</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;Def&quot;</span><span class="p">:</span><span class="s2">&quot;OSCMD&quot;</span><span class="p">,</span> <span class="c1"># def alias (look pyOpeRPA.Agent gSettings[&quot;ProcessorDict&quot;][&quot;AliasDefDict&quot;])</span>
<span class="s2">&quot;ArgList&quot;</span><span class="p">:[],</span> <span class="c1"># Args list</span>
<span class="s2">&quot;ArgDict&quot;</span><span class="p">:{</span><span class="s2">&quot;inCMDStr&quot;</span><span class="p">:</span><span class="n">inCMDStr</span><span class="p">,</span><span class="s2">&quot;inRunAsyncBool&quot;</span><span class="p">:</span><span class="n">inRunAsyncBool</span><span class="p">},</span> <span class="c1"># Args dictionary</span>
<span class="s2">&quot;ArgDict&quot;</span><span class="p">:{</span><span class="s2">&quot;inCMDStr&quot;</span><span class="p">:</span><span class="n">inCMDStr</span><span class="p">,</span><span class="s2">&quot;inRunAsyncBool&quot;</span><span class="p">:</span><span class="n">inRunAsyncBool</span><span class="p">,</span> <span class="s2">&quot;inSendOutputToOrchestratorLogsBool&quot;</span><span class="p">:</span> <span class="n">inSendOutputToOrchestratorLogsBool</span><span class="p">,</span> <span class="s2">&quot;inCMDEncodingStr&quot;</span><span class="p">:</span> <span class="n">inCMDEncodingStr</span><span class="p">},</span> <span class="c1"># Args dictionary</span>
<span class="s2">&quot;ArgGSettings&quot;</span><span class="p">:</span> <span class="s2">&quot;inGSettings&quot;</span><span class="p">,</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<span class="p">}</span>

@ -13,6 +13,9 @@ If you need to give some little rights for user only for one robot in orchestrat
To work with UAC you can use defs ``Orchestrator.UAC`` group.
!!!ATTENTION!!!
Need practice example to work with UAC! - too hard to understand
***************************************************
UAC Dict for Orchestrator WEB UI rights

@ -4,6 +4,23 @@
Here you can find the functions description for interaction with desktop GUI applications
How to use both x32 and x64 python processes (it can be helpfully, if another app GUI is on another bitness than your app)
.. code-block:: python
from pyOpenRPA.Robot import UIDesktop
#Section for robot init
lPyOpenRPA_SettingsDict = {
"Python32FullPath": "..\\Resources\\WPy32-3720\\python-3.7.2\\python.exe", #Set from user: "..\\Resources\\WPy32-3720\\python-3.7.2\\OpenRPARobotGUIx32.exe"
"Python64FullPath": "..\\Resources\\WPy64-3720\\python-3.7.2.amd64\\python.exe", #Set from user
"Python32ProcessName": "pyOpenRPA_UIDesktopX32.exe", #Config set once
"Python64ProcessName": "pyOpenRPA_UIDesktopX64.exe" #Config set once
}
# Init the pyOpenRPA configuration
UIDesktop.Utils.ProcessBitness.SettingsInit(lPyOpenRPA_SettingsDict)
# Now you can use pyOpenRPA with both bitness.
.. automodule:: pyOpenRPA.Robot.UIDesktop
:members:
:autosummary:

File diff suppressed because one or more lines are too long

@ -316,7 +316,7 @@ Add activity in AgentDict. Check if item is created
### pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=True)
### pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=True, inSendOutputToOrchestratorLogsBool=True, inCMDEncodingStr='cp1251')
Send CMD to OS thought the pyOpenRPA.Agent daemon. Result return to log + Orchestrator by the A2O connection
@ -326,16 +326,22 @@ Send CMD to OS thought the pyOpenRPA.Agent daemon. Result return to log + Orches
* **inGSettings** Global settings dict (singleton)
* **inHostNameStr**
* **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**
* **inUserStr** Agent user name in upper case (example “UserRPA”). Active agent session you can see on the orchestrator dashboard as Orchestrator admin
* **inCMDStr**
* **inCMDStr** command to execute on the Agent session
* **inRunAsyncBool**
* **inRunAsyncBool** True - Agent processor dont 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

@ -10,6 +10,10 @@ If you need to give some little rights for user only for one robot in orchestrat
To work with UAC you can use defs `Orchestrator.UAC` group.
!!!ATTENTION!!!
Need practice example to work with UAC! - too hard to understand
## UAC Dict for Orchestrator WEB UI rights
UAC Dict for pyOpenRPA Orchestrator WEB UI rights.

@ -2,6 +2,22 @@
Here you can find the functions description for interaction with desktop GUI applications
How to use both x32 and x64 python processes (it can be helpfully, if another app GUI is on another bitness than your app)
```
from pyOpenRPA.Robot import UIDesktop
#Section for robot init
lPyOpenRPA_SettingsDict = {
"Python32FullPath": "..\\Resources\\WPy32-3720\\python-3.7.2\\python.exe", #Set from user: "..\\Resources\\WPy32-3720\\python-3.7.2\\OpenRPARobotGUIx32.exe"
"Python64FullPath": "..\\Resources\\WPy64-3720\\python-3.7.2.amd64\\python.exe", #Set from user
"Python32ProcessName": "pyOpenRPA_UIDesktopX32.exe", #Config set once
"Python64ProcessName": "pyOpenRPA_UIDesktopX64.exe" #Config set once
}
# Init the pyOpenRPA configuration
UIDesktop.Utils.ProcessBitness.SettingsInit(lPyOpenRPA_SettingsDict)
# Now you can use pyOpenRPA with both bitness.
```
**Functions:**
| `Get_OSBitnessInt`()

Loading…
Cancel
Save