parent
52942b3679
commit
c989a55b1c
@ -0,0 +1,52 @@
|
||||
####################################
|
||||
6. Defs Managers
|
||||
####################################
|
||||
|
||||
**************************************************
|
||||
Process (General)
|
||||
**************************************************
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# EXAMPLE
|
||||
from pyOpenRPA.Orchestrator import Orchestrator
|
||||
lProcess = Orchestrator.Managers.Process(inAgentHostNameStr="PC-DESKTOP",inAgentUserNameStr="ND", inProcessNameWOExeStr="notepad",inStartCMDStr="notepad")
|
||||
|
||||
|
||||
.. automodule:: pyOpenRPA.Orchestrator.Managers.Process
|
||||
:members:
|
||||
:autosummary:
|
||||
|
||||
|
||||
**************************************************
|
||||
Process (Details)
|
||||
**************************************************
|
||||
|
||||
.. automodule:: pyOpenRPA.Orchestrator.Managers.Process
|
||||
:members:
|
||||
:autosummary:
|
||||
|
||||
|
||||
**************************************************
|
||||
ControlPanel (General)
|
||||
**************************************************
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# EXAMPLE
|
||||
from pyOpenRPA.Orchestrator import Orchestrator
|
||||
lCP = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="TestTTT",inRefreshHTMLJinja2TemplatePathStr="ControlPanel\\test.html", inJinja2TemplateRefreshBool = True)
|
||||
|
||||
|
||||
.. automodule:: pyOpenRPA.Orchestrator.Managers.ControlPanel
|
||||
:members:
|
||||
:autosummary:
|
||||
|
||||
|
||||
**************************************************
|
||||
ControlPanel (Details)
|
||||
**************************************************
|
||||
|
||||
.. automodule:: pyOpenRPA.Orchestrator.Managers.ControlPanel
|
||||
:members:
|
||||
:autosummary:
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,571 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>pyOpenRPA.Orchestrator.Managers.ControlPanel — pyOpenRPA v1.2.0 documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="../../../../_static/favicon.ico"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../../../../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../../" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="../../../../index.html" class="icon icon-home"> pyOpenRPA
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">GENERAL</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../01_HowToInstall.html">1. How to install</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../02_RoadMap.html">2. Roadmap</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../03_Copyrights_Contacts.html">3. Copyrights & Contacts</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">ROBOT</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/01_Robot.html">1. Description</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/02_Defs.html">2. Defs</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/03_HowToUse.html">3. How to use</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/04_Dependencies.html">4. Dependencies</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">STUDIO</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Studio/01_Studio.html">1. Description</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Studio/02_HowToUse.html">2. How to use</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">ORCHESTRATOR</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/01_Orchestrator.html">1. Description</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/02_Defs.html">2. Defs</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/03_gSettingsTemplate.html">3. gSettings Template</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/04_HowToUse.html">4. How to use</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/05_UAC.html">5. UAC - User Access Control</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/06_Defs%20Managers.html">6. Defs Managers</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">AGENT</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Agent/02_Defs.html">2. Defs</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../../../../index.html">pyOpenRPA</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../../../../index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li><a href="../../../index.html">Module code</a> »</li>
|
||||
|
||||
<li>pyOpenRPA.Orchestrator.Managers.ControlPanel</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pyOpenRPA.Orchestrator.Managers.ControlPanel</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">...</span> <span class="kn">import</span> <span class="n">Orchestrator</span>
|
||||
<span class="kn">import</span> <span class="nn">jinja2</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">from</span> <span class="nn">inspect</span> <span class="kn">import</span> <span class="n">signature</span> <span class="c1"># For detect count of def args</span>
|
||||
<span class="kn">from</span> <span class="nn">..Web</span> <span class="kn">import</span> <span class="n">Basic</span>
|
||||
<span class="kn">import</span> <span class="nn">operator</span>
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel">[docs]</a><span class="k">class</span> <span class="nc">ControlPanel</span><span class="p">():</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manage your control panel on the orchestrator</span>
|
||||
|
||||
<span class="sd"> Control panel has 3 events types:</span>
|
||||
<span class="sd"> - onRefreshHTML - run every n (see settings) second to detect changes in HTML control panel.</span>
|
||||
<span class="sd"> - onRefreshJSON - run every n (see settings) second to detect changes in JSON data container to client side.</span>
|
||||
<span class="sd"> - onInitJS - run when client reload the Orchestrator web page</span>
|
||||
|
||||
<span class="sd"> .. code-block:: python</span>
|
||||
|
||||
<span class="sd"> # Usage example:</span>
|
||||
<span class="sd"> lCPManager = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="TestControlPanel",</span>
|
||||
<span class="sd"> inRefreshHTMLJinja2TemplatePathStr="ControlPanel\\test.html", inJinja2TemplateRefreshBool = True)</span>
|
||||
|
||||
<span class="sd"> If you use Jinja2 you can use next data context:</span>
|
||||
<span class="sd"> StorageRobotDict: Orchestrator.StorageRobotGet(inRobotNameStr=self.mRobotNameStr),</span>
|
||||
<span class="sd"> ControlPanelInstance: self,</span>
|
||||
<span class="sd"> OrchestratorModule:Orchestrator,</span>
|
||||
<span class="sd"> RequestInstance: inRequest,</span>
|
||||
<span class="sd"> UserInfoDict: Orchestrator.WebUserInfoGet(inRequest=inRequest),</span>
|
||||
<span class="sd"> UserUACDict: Orchestrator.UACUserDictGet(inRequest=inRequest),</span>
|
||||
<span class="sd"> UserUACCheckDef: inRequest.UACClientCheck,</span>
|
||||
<span class="sd"> EnumerateDef: enumerate,</span>
|
||||
<span class="sd"> OperatorModule: operator,</span>
|
||||
<span class="sd"> MathModule: math</span>
|
||||
|
||||
<span class="sd"> .. code-block:: html</span>
|
||||
<span class="sd"> Hello my control panel!</span>
|
||||
<span class="sd"> You can use any def from Orchestrator module here in Jinja2 HTML template:</span>
|
||||
<span class="sd"> Example: OrchestratorModule.OSCMD(inCMDStr="notepad")</span>
|
||||
<span class="sd"> {{MathModule.pi}}</span>
|
||||
<span class="sd"> {% if UserInfoDict['UserNameUpperStr']=="ND" %}</span>
|
||||
<span class="sd"> YES - IT IS ND</span>
|
||||
<span class="sd"> {% endif %}</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">mControlPanelNameStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="c1"># Jinja2 consolidated</span>
|
||||
<span class="n">mJinja2TemplateRefreshBool</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mJinja2DataUpdateDict</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<span class="c1"># RefreshHTML block</span>
|
||||
<span class="n">mRefreshHTMLJinja2TemplatePathStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mRefreshHTMLJinja2TemplateFileNameStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mRefreshHTMLJinja2Loader</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mRefreshHTMLJinja2Env</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mRefreshHTMLJinja2Template</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<span class="c1"># InitJS block</span>
|
||||
<span class="n">mInitJSJinja2TemplatePathStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mInitJSJinja2TemplateFileNameStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mInitJSJinja2Loader</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mInitJSJinja2Env</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mInitJSJinja2Template</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<span class="n">mBackwardCompatibilityHTMLDef</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mBackwardCompatibilityJSDef</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mBackwardCompatibilityJSONDef</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<span class="n">mRobotNameStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inControlPanelNameStr</span><span class="p">,</span> <span class="n">inRefreshHTMLJinja2TemplatePathStr</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">inJinja2TemplateRefreshBool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="n">inRobotNameStr</span> <span class="o">=</span> <span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Constructor of the control panel manager</span>
|
||||
|
||||
<span class="sd"> :param inControlPanelNameStr:</span>
|
||||
<span class="sd"> :param inJinja2TemplatePathStr:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Connect self witch pyOpenRPA via ControlPanelNameStr</span>
|
||||
<span class="k">if</span> <span class="n">inControlPanelNameStr</span> <span class="ow">in</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()[</span><span class="s2">"ServerDict"</span><span class="p">][</span><span class="s2">"ControlPanelDict"</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">"Another control panel with name </span><span class="si">{</span><span class="n">inControlPanelNameStr</span><span class="si">}</span><span class="s2"> is already exists. Please resolve the error and restart"</span><span class="p">)</span>
|
||||
<span class="n">Orchestrator</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()[</span><span class="s2">"ServerDict"</span><span class="p">][</span><span class="s2">"ControlPanelDict"</span><span class="p">][</span><span class="n">inControlPanelNameStr</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">RefreshHTMLJinja2TemplatePathSet</span><span class="p">(</span><span class="n">inJinja2TemplatePathStr</span> <span class="o">=</span> <span class="n">inRefreshHTMLJinja2TemplatePathStr</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mJinja2TemplateRefreshBool</span> <span class="o">=</span> <span class="n">inJinja2TemplateRefreshBool</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mControlPanelNameStr</span> <span class="o">=</span> <span class="n">inControlPanelNameStr</span> <span class="c1"># Set the name of the control panel</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mRobotNameStr</span> <span class="o">=</span> <span class="n">inRobotNameStr</span> <span class="c1"># Set the robot name for robot it execute</span>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.Jinja2DataUpdateDictSet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.Jinja2DataUpdateDictSet">[docs]</a> <span class="k">def</span> <span class="nf">Jinja2DataUpdateDictSet</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inJinja2DataUpdateDict</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Set the data dict from the Jinja2 context (you can add some new params)</span>
|
||||
|
||||
<span class="sd"> :param inJinja2DataUpdateDict: dict, which will be appended to main data context</span>
|
||||
<span class="sd"> :return: None</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mJinja2DataUpdateDict</span> <span class="o">=</span> <span class="n">inJinja2DataUpdateDict</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.RefreshHTMLJinja2TemplatePathSet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.RefreshHTMLJinja2TemplatePathSet">[docs]</a> <span class="k">def</span> <span class="nf">RefreshHTMLJinja2TemplatePathSet</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inJinja2TemplatePathStr</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Create Jinja2 env and load the template html</span>
|
||||
|
||||
<span class="sd"> :param inJinja2TemplatePathStr:</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">inJinja2TemplatePathStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">lSystemLoaderPathStr</span> <span class="o">=</span> <span class="s2">"/"</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">inJinja2TemplatePathStr</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"</span><span class="se">\\</span><span class="s2">"</span><span class="p">)[</span><span class="mi">0</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
|
||||
<span class="n">lTemplateFileNameStr</span> <span class="o">=</span> <span class="n">inJinja2TemplatePathStr</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"</span><span class="se">\\</span><span class="s2">"</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2TemplateFileNameStr</span> <span class="o">=</span> <span class="n">lTemplateFileNameStr</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Loader</span> <span class="o">=</span> <span class="n">jinja2</span><span class="o">.</span><span class="n">FileSystemLoader</span><span class="p">(</span><span class="n">lSystemLoaderPathStr</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Env</span> <span class="o">=</span> <span class="n">jinja2</span><span class="o">.</span><span class="n">Environment</span><span class="p">(</span><span class="n">loader</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Loader</span><span class="p">,</span> <span class="n">trim_blocks</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Template</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Env</span><span class="o">.</span><span class="n">get_template</span><span class="p">(</span><span class="n">lTemplateFileNameStr</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span><span class="o">.</span><span class="n">exception</span><span class="p">(</span><span class="s2">"EXCEPTION WHEN INIT Jinja2"</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.RefreshHTMLJinja2StrGenerate"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.RefreshHTMLJinja2StrGenerate">[docs]</a> <span class="k">def</span> <span class="nf">RefreshHTMLJinja2StrGenerate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inDataDict</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Generate the HTML str from the Jinja2. Pass the context inDataDict</span>
|
||||
<span class="sd"> :param inDataDict:</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mJinja2TemplateRefreshBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Template</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Env</span><span class="o">.</span><span class="n">get_template</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2TemplateFileNameStr</span><span class="p">)</span>
|
||||
<span class="n">lHTMLStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Template</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="o">**</span><span class="n">inDataDict</span><span class="p">)</span> <span class="c1"># Render the template into str</span>
|
||||
<span class="k">return</span> <span class="n">lHTMLStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.InitJSJinja2TemplatePathSet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.InitJSJinja2TemplatePathSet">[docs]</a> <span class="k">def</span> <span class="nf">InitJSJinja2TemplatePathSet</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inJinja2TemplatePathStr</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Create Jinja2 env and load the template html</span>
|
||||
|
||||
<span class="sd"> :param inJinja2TemplatePathStr:</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">inJinja2TemplatePathStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">lSystemLoaderPathStr</span> <span class="o">=</span> <span class="s2">"/"</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">inJinja2TemplatePathStr</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"</span><span class="se">\\</span><span class="s2">"</span><span class="p">)[</span><span class="mi">0</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
|
||||
<span class="n">lTemplateFileNameStr</span> <span class="o">=</span> <span class="n">inJinja2TemplatePathStr</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"</span><span class="se">\\</span><span class="s2">"</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2TemplateFileNameStr</span> <span class="o">=</span> <span class="n">lTemplateFileNameStr</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Loader</span> <span class="o">=</span> <span class="n">jinja2</span><span class="o">.</span><span class="n">FileSystemLoader</span><span class="p">(</span><span class="n">lSystemLoaderPathStr</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Env</span> <span class="o">=</span> <span class="n">jinja2</span><span class="o">.</span><span class="n">Environment</span><span class="p">(</span><span class="n">loader</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Loader</span><span class="p">,</span> <span class="n">trim_blocks</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Template</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Env</span><span class="o">.</span><span class="n">get_template</span><span class="p">(</span><span class="n">lTemplateFileNameStr</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span><span class="o">.</span><span class="n">exception</span><span class="p">(</span><span class="s2">"EXCEPTION WHEN INIT Jinja2"</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.InitJSJinja2StrGenerate"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.InitJSJinja2StrGenerate">[docs]</a> <span class="k">def</span> <span class="nf">InitJSJinja2StrGenerate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inDataDict</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Generate the HTML str from the Jinja2. Pass the context inDataDict</span>
|
||||
<span class="sd"> :param inDataDict:</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mJinja2TemplateRefreshBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Template</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Env</span><span class="o">.</span><span class="n">get_template</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2TemplateFileNameStr</span><span class="p">)</span>
|
||||
<span class="n">lHTMLStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Template</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="o">**</span><span class="n">inDataDict</span><span class="p">)</span> <span class="c1"># Render the template into str</span>
|
||||
<span class="k">return</span> <span class="n">lHTMLStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.DataDictGenerate"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.DataDictGenerate">[docs]</a> <span class="k">def</span> <span class="nf">DataDictGenerate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lData</span> <span class="o">=</span> <span class="p">{</span>
|
||||
<span class="s2">"StorageRobotDict"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"ControlPanelInstance"</span><span class="p">:</span><span class="bp">self</span><span class="p">,</span>
|
||||
<span class="s2">"OrchestratorModule"</span><span class="p">:</span><span class="n">Orchestrator</span><span class="p">,</span>
|
||||
<span class="s2">"RequestInstance"</span><span class="p">:</span> <span class="n">inRequest</span><span class="p">,</span>
|
||||
<span class="s2">"UserInfoDict"</span><span class="p">:</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">WebUserInfoGet</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">),</span>
|
||||
<span class="s2">"UserUACDict"</span><span class="p">:</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">UACUserDictGet</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">),</span>
|
||||
<span class="s2">"UserUACCheckDef"</span><span class="p">:</span> <span class="n">inRequest</span><span class="o">.</span><span class="n">UACClientCheck</span><span class="p">,</span>
|
||||
<span class="s2">"EnumerateDef"</span><span class="p">:</span> <span class="nb">enumerate</span><span class="p">,</span>
|
||||
<span class="s2">"OperatorModule"</span><span class="p">:</span> <span class="n">operator</span><span class="p">,</span>
|
||||
<span class="s2">"MathModule"</span><span class="p">:</span> <span class="n">math</span>
|
||||
<span class="p">}</span>
|
||||
<span class="c1"># Get the robot storage by the robot name (if you set robot name when init)</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mRobotNameStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">lData</span><span class="p">[</span><span class="s2">"StorageRobotDict"</span><span class="p">]</span> <span class="o">=</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">StorageRobotGet</span><span class="p">(</span><span class="n">inRobotNameStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mRobotNameStr</span><span class="p">)</span>
|
||||
<span class="c1"># Checkj Jinja2DataUpdateDict</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mJinja2DataUpdateDict</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">lData</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mJinja2DataUpdateDict</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">lData</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.OnRefreshHTMLStr"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.OnRefreshHTMLStr">[docs]</a> <span class="k">def</span> <span class="nf">OnRefreshHTMLStr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Event to generate HTML code of the control panel when refresh time is over.</span>
|
||||
<span class="sd"> Support backward compatibility for previous versions.</span>
|
||||
|
||||
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lHTMLStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">lL</span> <span class="o">=</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mBackwardCompatibilityHTMLDef</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2Template</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">or</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mJinja2TemplateRefreshBool</span> <span class="o">==</span> <span class="kc">True</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">mRefreshHTMLJinja2TemplateFileNameStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">):</span>
|
||||
<span class="n">lDataDict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">OnRefreshHTMLDataDict</span><span class="p">(</span><span class="n">inRequest</span> <span class="o">=</span> <span class="n">inRequest</span><span class="p">)</span>
|
||||
<span class="c1"># Jinja code</span>
|
||||
<span class="n">lHTMLStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">RefreshHTMLJinja2StrGenerate</span><span class="p">(</span><span class="n">inDataDict</span><span class="o">=</span><span class="n">lDataDict</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">lHTMLStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">BackwardAdapterHTMLDef</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">)</span>
|
||||
<span class="c1"># return the str</span>
|
||||
<span class="k">return</span> <span class="n">lHTMLStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.OnRefreshHTMLDataDict"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.OnRefreshHTMLDataDict">[docs]</a> <span class="k">def</span> <span class="nf">OnRefreshHTMLDataDict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Event to prepare data context for the futher Jinja2 HTML generation. You can override this def if you want some thing more data</span>
|
||||
|
||||
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
|
||||
<span class="sd"> :return: dict</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">DataDictGenerate</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.OnRefreshHTMLHashStr"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.OnRefreshHTMLHashStr">[docs]</a> <span class="k">def</span> <span class="nf">OnRefreshHTMLHashStr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Generate the hash the result output HTML. You can override this function if you know how to optimize HTML rendering.</span>
|
||||
<span class="sd"> TODO NEED TO MODIFY ServerSettings to work with Hash because of all defs are need do use Hash</span>
|
||||
|
||||
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
|
||||
<span class="sd"> :return: None - default, hash function is not determined. Str - hash function is working on!</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="kc">None</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.OnRefreshJSONDict"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.OnRefreshJSONDict">[docs]</a> <span class="k">def</span> <span class="nf">OnRefreshJSONDict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Event to transmit some data from server side to the client side in JSON format. Call when page refresh is initialized</span>
|
||||
|
||||
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
|
||||
<span class="sd"> :return: Dict type</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lResultDict</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mBackwardCompatibilityJSONDef</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">pass</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">lResultDict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">BackwardAdapterJSONDef</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">lResultDict</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.OnInitJSStr"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.OnInitJSStr">[docs]</a> <span class="k">def</span> <span class="nf">OnInitJSStr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Event when orchestrator web page is init on the client side - you can transmit some java script code is str type to execute it once.</span>
|
||||
|
||||
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
|
||||
<span class="sd"> :return: ""</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lJSStr</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mBackwardCompatibilityJSDef</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2Template</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">or</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mJinja2TemplateRefreshBool</span> <span class="o">==</span> <span class="kc">True</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">mInitJSJinja2TemplateFileNameStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">):</span>
|
||||
<span class="n">lDataDict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">OnInitJSDataDict</span><span class="p">(</span><span class="n">inRequest</span> <span class="o">=</span> <span class="n">inRequest</span><span class="p">)</span>
|
||||
<span class="c1"># Jinja code</span>
|
||||
<span class="n">lJSStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">InitJSJinja2StrGenerate</span><span class="p">(</span><span class="n">inDataDict</span><span class="o">=</span><span class="n">lDataDict</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">lJSStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">BackwardAdapterJSDef</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">lJSStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ControlPanel.OnInitJSDataDict"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.ControlPanel.ControlPanel.OnInitJSDataDict">[docs]</a> <span class="k">def</span> <span class="nf">OnInitJSDataDict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Event to prepare data context for the futher Jinja2 JS init generation. You can override this def if you want some thing more data</span>
|
||||
|
||||
<span class="sd"> :param inRequest: request handler (from http.server import BaseHTTPRequestHandler)</span>
|
||||
<span class="sd"> :return: dict</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">DataDictGenerate</span><span class="p">(</span><span class="n">inRequest</span><span class="o">=</span><span class="n">inRequest</span><span class="p">)</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="nf">BackwardAdapterHTMLDef</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="n">lGS</span> <span class="o">=</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()</span>
|
||||
<span class="n">lL</span> <span class="o">=</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span>
|
||||
<span class="c1"># HTMLRenderDef</span>
|
||||
<span class="n">lItemHTMLRenderDef</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mBackwardCompatibilityHTMLDef</span>
|
||||
<span class="n">lResultStr</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="k">if</span> <span class="n">lItemHTMLRenderDef</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="c1"># Call def (inRequest, inGSettings) or def (inGSettings)</span>
|
||||
<span class="n">lHTMLResult</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">lDEFSignature</span> <span class="o">=</span> <span class="n">signature</span><span class="p">(</span><span class="n">lItemHTMLRenderDef</span><span class="p">)</span> <span class="c1"># Get signature of the def</span>
|
||||
<span class="n">lDEFARGLen</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">lDEFSignature</span><span class="o">.</span><span class="n">parameters</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span> <span class="c1"># get count of the def args</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> <span class="c1"># def (inGSettings)</span>
|
||||
<span class="n">lHTMLResult</span> <span class="o">=</span> <span class="n">lItemHTMLRenderDef</span><span class="p">(</span><span class="n">lGS</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span> <span class="c1"># def (inRequest, inGSettings)</span>
|
||||
<span class="n">lHTMLResult</span> <span class="o">=</span> <span class="n">lItemHTMLRenderDef</span><span class="p">(</span><span class="n">inRequest</span><span class="p">,</span> <span class="n">lGS</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> <span class="c1"># def ()</span>
|
||||
<span class="n">lHTMLResult</span> <span class="o">=</span> <span class="n">lItemHTMLRenderDef</span><span class="p">()</span>
|
||||
<span class="c1"># RunFunction</span>
|
||||
<span class="c1"># Backward compatibility up to 1.2.0 - call HTML generator if result has no "HTMLStr"</span>
|
||||
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">lHTMLResult</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="n">lResultStr</span> <span class="o">=</span> <span class="n">lHTMLResult</span>
|
||||
<span class="k">elif</span> <span class="s2">"HTMLStr"</span> <span class="ow">in</span> <span class="n">lHTMLResult</span> <span class="ow">or</span> <span class="s2">"JSONDict"</span> <span class="ow">in</span> <span class="n">lHTMLResult</span><span class="p">:</span>
|
||||
<span class="n">lResultStr</span> <span class="o">=</span> <span class="n">lHTMLResult</span><span class="p">[</span><span class="s2">"HTMLStr"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># Call backward compatibility HTML generator</span>
|
||||
<span class="n">lResultStr</span> <span class="o">=</span> <span class="n">Basic</span><span class="o">.</span><span class="n">HTMLControlPanelBC</span><span class="p">(</span><span class="n">inCPDict</span><span class="o">=</span><span class="n">lHTMLResult</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<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">exception</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Error in control panel HTMLRenderDef. CP Key </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mControlPanelNameStr</span><span class="si">}</span><span class="s2">. Exception are below"</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">lResultStr</span>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">BackwardAdapterJSONDef</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="n">lGS</span> <span class="o">=</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()</span>
|
||||
<span class="n">lL</span> <span class="o">=</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span>
|
||||
<span class="c1"># HTMLRenderDef</span>
|
||||
<span class="n">lItemJSONGeneratorDef</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mBackwardCompatibilityJSONDef</span>
|
||||
<span class="n">lResultDict</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
<span class="k">if</span> <span class="n">lItemJSONGeneratorDef</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="c1"># Call def (inRequest, inGSettings) or def (inGSettings)</span>
|
||||
<span class="n">lJSONResult</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">lDEFSignature</span> <span class="o">=</span> <span class="n">signature</span><span class="p">(</span><span class="n">lItemJSONGeneratorDef</span><span class="p">)</span> <span class="c1"># Get signature of the def</span>
|
||||
<span class="n">lDEFARGLen</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">lDEFSignature</span><span class="o">.</span><span class="n">parameters</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span> <span class="c1"># get count of the def args</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> <span class="c1"># def (inGSettings)</span>
|
||||
<span class="n">lJSONResult</span> <span class="o">=</span> <span class="n">lItemJSONGeneratorDef</span><span class="p">(</span><span class="n">lGS</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span> <span class="c1"># def (inRequest, inGSettings)</span>
|
||||
<span class="n">lJSONResult</span> <span class="o">=</span> <span class="n">lItemJSONGeneratorDef</span><span class="p">(</span><span class="n">inRequest</span><span class="p">,</span> <span class="n">lGS</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> <span class="c1"># def ()</span>
|
||||
<span class="n">lJSONResult</span> <span class="o">=</span> <span class="n">lItemJSONGeneratorDef</span><span class="p">()</span>
|
||||
<span class="c1"># RunFunction</span>
|
||||
<span class="c1"># Backward compatibility up to 1.2.0 - call HTML generator if result has no "HTMLStr"</span>
|
||||
<span class="n">lType</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">lJSONResult</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">lType</span> <span class="ow">is</span> <span class="nb">str</span> <span class="ow">or</span> <span class="n">lJSONResult</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">lType</span> <span class="ow">is</span> <span class="nb">int</span> <span class="ow">or</span> <span class="n">lType</span> <span class="ow">is</span> <span class="nb">list</span> <span class="ow">or</span> <span class="n">lType</span> <span class="ow">is</span> <span class="nb">dict</span> <span class="ow">or</span> <span class="n">lType</span> <span class="ow">is</span> <span class="nb">bool</span> <span class="ow">or</span> <span class="n">lType</span> <span class="ow">is</span> <span class="nb">float</span><span class="p">:</span>
|
||||
<span class="n">lResultDict</span> <span class="o">=</span> <span class="n">lJSONResult</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<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">warning</span><span class="p">(</span><span class="sa">f</span><span class="s2">"JSONGenerator return bad type: </span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">lJSONResult</span><span class="p">))</span><span class="si">}</span><span class="s2">, CP Key </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mControlPanelNameStr</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<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">exception</span><span class="p">(</span>
|
||||
<span class="sa">f</span><span class="s2">"Error in control panel JSONGeneratorDef. CP Key </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mControlPanelNameStr</span><span class="si">}</span><span class="s2">. Exception are below"</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">lResultDict</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">BackwardAdapterJSDef</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">inRequest</span><span class="p">):</span>
|
||||
<span class="n">lGS</span> <span class="o">=</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()</span>
|
||||
<span class="n">lL</span> <span class="o">=</span> <span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span>
|
||||
<span class="c1"># HTMLRenderDef</span>
|
||||
<span class="n">lJSInitGeneratorDef</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mBackwardCompatibilityJSDef</span>
|
||||
<span class="n">lResultStr</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="k">if</span> <span class="n">lJSInitGeneratorDef</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="c1"># Call def (inRequest, inGSettings) or def (inGSettings)</span>
|
||||
<span class="n">lJSResult</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="n">lDEFSignature</span> <span class="o">=</span> <span class="n">signature</span><span class="p">(</span><span class="n">lJSInitGeneratorDef</span><span class="p">)</span> <span class="c1"># Get signature of the def</span>
|
||||
<span class="n">lDEFARGLen</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">lDEFSignature</span><span class="o">.</span><span class="n">parameters</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span> <span class="c1"># get count of the def args</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> <span class="c1"># def (inGSettings)</span>
|
||||
<span class="n">lJSResult</span> <span class="o">=</span> <span class="n">lJSInitGeneratorDef</span><span class="p">(</span><span class="n">lGS</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span> <span class="c1"># def (inRequest, inGSettings)</span>
|
||||
<span class="n">lJSResult</span> <span class="o">=</span> <span class="n">lJSInitGeneratorDef</span><span class="p">(</span><span class="n">inRequest</span><span class="p">,</span> <span class="n">lGS</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">lDEFARGLen</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> <span class="c1"># def ()</span>
|
||||
<span class="n">lJSResult</span> <span class="o">=</span> <span class="n">lJSInitGeneratorDef</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">lJSResult</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="n">lResultStr</span> <span class="o">=</span> <span class="n">lJSResult</span> <span class="c1"># Add delimiter to some cases</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<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">warning</span><span class="p">(</span><span class="sa">f</span><span class="s2">"JSInitGenerator return bad type: </span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">lJSResult</span><span class="p">))</span><span class="si">}</span><span class="s2">, CP Key </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mControlPanelNameStr</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<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">exception</span><span class="p">(</span>
|
||||
<span class="sa">f</span><span class="s2">"Error in control panel JSInitGeneratorDef. CP Key </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mControlPanelNameStr</span><span class="si">}</span><span class="s2">. Exception are below"</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">lResultStr</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, Ivan Maslov.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||||
|
||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,567 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>pyOpenRPA.Orchestrator.Managers.Process — pyOpenRPA v1.2.0 documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="../../../../_static/favicon.ico"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../../../../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../../" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="../../../../index.html" class="icon icon-home"> pyOpenRPA
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">GENERAL</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../01_HowToInstall.html">1. How to install</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../02_RoadMap.html">2. Roadmap</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../03_Copyrights_Contacts.html">3. Copyrights & Contacts</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">ROBOT</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/01_Robot.html">1. Description</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/02_Defs.html">2. Defs</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/03_HowToUse.html">3. How to use</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/04_Dependencies.html">4. Dependencies</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">STUDIO</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Studio/01_Studio.html">1. Description</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Studio/02_HowToUse.html">2. How to use</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">ORCHESTRATOR</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/01_Orchestrator.html">1. Description</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/02_Defs.html">2. Defs</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/03_gSettingsTemplate.html">3. gSettings Template</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/04_HowToUse.html">4. How to use</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/05_UAC.html">5. UAC - User Access Control</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/06_Defs%20Managers.html">6. Defs Managers</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">AGENT</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../../Agent/02_Defs.html">2. Defs</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../../../../index.html">pyOpenRPA</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../../../../index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li><a href="../../../index.html">Module code</a> »</li>
|
||||
|
||||
<li>pyOpenRPA.Orchestrator.Managers.Process</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pyOpenRPA.Orchestrator.Managers.Process</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1">#from pyOpenRPA.Orchestrator import Managers</span>
|
||||
<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">__Orchestrator__</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
|
||||
<div class="viewcode-block" id="Process"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process">[docs]</a><span class="k">class</span> <span class="nc">Process</span><span class="p">():</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manager process, which is need to be started / stopped / restarted</span>
|
||||
|
||||
<span class="sd"> With Process instance you can automate your process activity. Use schedule package to set interval when process should be active and when not.</span>
|
||||
|
||||
<span class="sd"> Process instance has the following statuses:</span>
|
||||
<span class="sd"> - 0_STOPPED</span>
|
||||
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
||||
<span class="sd"> - 2_STOP_SAFE</span>
|
||||
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
||||
<span class="sd"> - 4_STARTED</span>
|
||||
<span class="sd"> - 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">mAgentHostNameStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mAgentUserNameStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mStartPathStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mStartCMDStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mProcessNameWOExeStr</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">mStatusStr</span> <span class="o">=</span> <span class="kc">None</span> <span class="c1"># 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">,</span> <span class="n">inStartPathStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inStartCMDStr</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">inStopSafeTimeoutSecFloat</span><span class="o">=</span><span class="mi">120</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mStartPathStr</span> <span class="o">=</span> <span class="n">inStartPathStr</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mStartCMDStr</span> <span class="o">=</span> <span class="n">inStartCMDStr</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span> <span class="o">=</span> <span class="n">inProcessNameWOExeStr</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="n">inStopSafeTimeoutSecFloat</span>
|
||||
<span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()[</span><span class="s2">"ManagersProcessDict"</span><span class="p">][(</span><span class="n">inAgentHostNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inAgentUserNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">())]</span><span class="o">=</span><span class="bp">self</span>
|
||||
<span class="n">lActivityDict</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span><span class="n">inDef</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">,</span><span class="n">inArgList</span><span class="o">=</span><span class="p">[])</span>
|
||||
<span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemAppend</span><span class="p">(</span><span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityDict</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="Process.Manual2Auto"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.Manual2Auto">[docs]</a> <span class="k">def</span> <span class="nf">Manual2Auto</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):</span>
|
||||
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lLogBool</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="o">==</span><span class="s2">"1_STOPPED_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="o">==</span><span class="s2">"3_STOP_SAFE_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"2_STOP_SAFE"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="o">==</span><span class="s2">"5_STARTED_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"4_STARTED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="c1"># Log info about process</span>
|
||||
<span class="k">if</span> <span class="n">lLogBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.Start"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.Start">[docs]</a> <span class="k">def</span> <span class="nf">Start</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manual/Auto start. Manual start will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
||||
|
||||
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Send activity item to agent - wait result</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartPathStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">lCMDStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"start </span><span class="si">{</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mStartPathStr</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span>
|
||||
<span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartCMDStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">lCMDStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"start </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mStartCMDStr</span><span class="si">}</span><span class="s2">"</span>
|
||||
<span class="c1">#import pdb</span>
|
||||
<span class="c1">#pdb.set_trace()</span>
|
||||
<span class="n">lActivityItemStart</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span><span class="n">inDef</span><span class="o">=</span><span class="s2">"OSCMD"</span><span class="p">,</span>
|
||||
<span class="n">inArgDict</span><span class="o">=</span><span class="p">{</span><span class="s2">"inCMDStr"</span><span class="p">:</span><span class="n">lCMDStr</span><span class="p">,</span><span class="s2">"inSendOutputToOrchestratorLogsBool"</span><span class="p">:</span><span class="kc">False</span><span class="p">},</span>
|
||||
<span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="s2">"inGSettings"</span><span class="p">)</span>
|
||||
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inHostNameStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="p">,</span>
|
||||
<span class="n">inUserStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="p">,</span>
|
||||
<span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemStart</span><span class="p">)</span>
|
||||
<span class="n">lStartResult</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemReturnGet</span><span class="p">(</span><span class="n">inGUIDStr</span><span class="o">=</span><span class="n">lGUIDStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">inIsManualBool</span><span class="o">==</span><span class="kc">True</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"5_STARTED_MANUAL"</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"4_STARTED"</span>
|
||||
<span class="c1"># Log info about process</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.StopSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StopSafe">[docs]</a> <span class="k">def</span> <span class="nf">StopSafe</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manual/Auto stop safe. Stop safe is the operation which send signal to process to terminate own work (send term signal to process). Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it.</span>
|
||||
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
||||
|
||||
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.StopForce"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StopForce">[docs]</a> <span class="k">def</span> <span class="nf">StopForce</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manual/Auto stop force. Force stop dont wait process termination - it just terminate process now.</span>
|
||||
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
||||
|
||||
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Send activity item to agent - wait result</span>
|
||||
<span class="n">lCMDStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">'taskkill /im "</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s1">.exe" /fi "username eq %USERNAME%"'</span>
|
||||
<span class="n">lActivityItemStart</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span>
|
||||
<span class="n">inDef</span><span class="o">=</span><span class="s2">"OSCMD"</span><span class="p">,</span><span class="n">inArgDict</span><span class="o">=</span><span class="p">{</span><span class="s2">"inCMDStr"</span><span class="p">:</span> <span class="n">lCMDStr</span><span class="p">,</span><span class="s2">"inSendOutputToOrchestratorLogsBool"</span><span class="p">:</span><span class="kc">False</span><span class="p">},</span><span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="s2">"inGSettings"</span><span class="p">)</span>
|
||||
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inHostNameStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="p">,</span>
|
||||
<span class="n">inUserStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="p">,</span>
|
||||
<span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemStart</span><span class="p">)</span>
|
||||
<span class="n">lStartResult</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemReturnGet</span><span class="p">(</span><span class="n">inGUIDStr</span><span class="o">=</span><span class="n">lGUIDStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">inIsManualBool</span><span class="o">==</span><span class="kc">True</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"1_STOPPED_MANUAL"</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span>
|
||||
<span class="c1"># Log info about process</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.RestartSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.RestartSafe">[docs]</a> <span class="k">def</span> <span class="nf">RestartSafe</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manual/Auto restart safe. Restart safe is the operation which send signal to process to terminate own work (send term signal to process). Then it run process. Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it.</span>
|
||||
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
||||
|
||||
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.RestartForce"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.RestartForce">[docs]</a> <span class="k">def</span> <span class="nf">RestartForce</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manual/Auto restart force. Force restart dont wait process termination - it just terminate process now ant then start it.</span>
|
||||
<span class="sd"> Manual restart will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
||||
|
||||
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.StatusChangeLog"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusChangeLog">[docs]</a> <span class="k">def</span> <span class="nf">StatusChangeLog</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Lof information about status change</span>
|
||||
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Log info about process</span>
|
||||
<span class="n">lL</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</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="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): Status has been changed to </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="si">}</span><span class="s2">)"</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="Process.StatusCheck"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheck">[docs]</a> <span class="k">def</span> <span class="nf">StatusCheck</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Check if process is alive. The def will save the manual flag is exists.</span>
|
||||
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Send activity item to agent - wait result</span>
|
||||
<span class="n">lLogBool</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="n">lActivityItemUserProcessList</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span><span class="n">inDef</span><span class="o">=</span><span class="s2">"ProcessWOExeUpperUserListGet"</span><span class="p">)</span>
|
||||
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inHostNameStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="p">,</span><span class="n">inUserStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="p">,</span><span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemUserProcessList</span><span class="p">)</span>
|
||||
<span class="n">lUserProcessList</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemReturnGet</span><span class="p">(</span><span class="n">inGUIDStr</span><span class="o">=</span><span class="n">lGUIDStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="n">lUserProcessList</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"1_STOPPED_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"5_STARTED_MANUAL"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"0_STOPPED"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"4_STARTED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"4_STARTED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"5_STARTED_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"1_STOPPED_MANUAL"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"4_STARTED"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="c1"># Log info about process</span>
|
||||
<span class="k">if</span> <span class="n">lLogBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
||||
<div class="viewcode-block" id="Process.StatusCheckStart"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheckStart">[docs]</a> <span class="k">def</span> <span class="nf">StatusCheckStart</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Check process status and run it if auto stopped self.mStatusStr is "0_STOPPED"</span>
|
||||
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.StatusCheckStopForce"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheckStopForce">[docs]</a> <span class="k">def</span> <span class="nf">StatusCheckStopForce</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Check process status and auto stop force it if self.mStatusStr is 4_STARTED</span>
|
||||
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.StatusCheckStopSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheckStopSafe">[docs]</a> <span class="k">def</span> <span class="nf">StatusCheckStopSafe</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Check process status and auto stop safe it if self.mStatusStr is 4_STARTED</span>
|
||||
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Process.ScheduleWeekDay"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.ScheduleWeekDay">[docs]</a> <span class="k">def</span> <span class="nf">ScheduleWeekDay</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Some template def to work with schedule package. Configure schedule to start. Stop process in auto mode in all sele.</span>
|
||||
|
||||
<span class="sd"> :return:</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="ProcessGet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessGet">[docs]</a><span class="k">def</span> <span class="nf">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="n">Process</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Return the process instance by the inProcessNameWOExeStr</span>
|
||||
|
||||
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
||||
<span class="sd"> :return: Process instance (if exists) Else None</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()[</span><span class="s2">"ManagersProcessDict"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">((</span><span class="n">inAgentHostNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inAgentUserNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">()),</span><span class="kc">None</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ProcessStatusStrGet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStatusStrGet">[docs]</a><span class="k">def</span> <span class="nf">ProcessStatusStrGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Get the status of the Process instance.</span>
|
||||
|
||||
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
||||
<span class="sd"> Process instance has the following statuses:</span>
|
||||
<span class="sd"> - 0_STOPPED</span>
|
||||
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
||||
<span class="sd"> - 2_STOP_SAFE</span>
|
||||
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
||||
<span class="sd"> - 4_STARTED</span>
|
||||
<span class="sd"> - 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> - None (if Process instance not exists)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ProcessStart"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStart">[docs]</a><span class="k">def</span> <span class="nf">ProcessStart</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inIsManualBool</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manual/Auto start. Manual start will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
||||
|
||||
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
||||
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
||||
<span class="sd"> Process instance has the following statuses:</span>
|
||||
<span class="sd"> - 0_STOPPED</span>
|
||||
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
||||
<span class="sd"> - 2_STOP_SAFE</span>
|
||||
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
||||
<span class="sd"> - 4_STARTED</span>
|
||||
<span class="sd"> - 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> - None (if Process instance not exists)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">Start</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="ProcessStopSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStopSafe">[docs]</a><span class="k">def</span> <span class="nf">ProcessStopSafe</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inIsManualBool</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manual/Auto stop safe. Stop safe is the operation which send signal to process to terminate own work (send term signal to process). Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it.</span>
|
||||
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
||||
|
||||
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
||||
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
||||
<span class="sd"> Process instance has the following statuses:</span>
|
||||
<span class="sd"> - 0_STOPPED</span>
|
||||
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
||||
<span class="sd"> - 2_STOP_SAFE</span>
|
||||
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
||||
<span class="sd"> - 4_STARTED</span>
|
||||
<span class="sd"> - 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> - None (if Process instance not exists)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">StopSafe</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ProcessStopForce"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStopForce">[docs]</a><span class="k">def</span> <span class="nf">ProcessStopForce</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inIsManualBool</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Manual/Auto stop force. Force stop dont wait process termination - it just terminate process now.</span>
|
||||
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
||||
|
||||
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
||||
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
||||
<span class="sd"> Process instance has the following statuses:</span>
|
||||
<span class="sd"> - 0_STOPPED</span>
|
||||
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
||||
<span class="sd"> - 2_STOP_SAFE</span>
|
||||
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
||||
<span class="sd"> - 4_STARTED</span>
|
||||
<span class="sd"> - 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> - None (if Process instance not exists)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">StopForce</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ProcessStatusCheck"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStatusCheck">[docs]</a><span class="k">def</span> <span class="nf">ProcessStatusCheck</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Check if process is alive. The def will save the manual flag is exists.</span>
|
||||
|
||||
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
||||
<span class="sd"> Process instance has the following statuses:</span>
|
||||
<span class="sd"> - 0_STOPPED</span>
|
||||
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
||||
<span class="sd"> - 2_STOP_SAFE</span>
|
||||
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
||||
<span class="sd"> - 4_STARTED</span>
|
||||
<span class="sd"> - 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> - None (if Process instance not exists)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
||||
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">lProcess</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ProcessManual2Auto"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessManual2Auto">[docs]</a><span class="k">def</span> <span class="nf">ProcessManual2Auto</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):</span>
|
||||
|
||||
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
||||
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
||||
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
||||
<span class="sd"> Process instance has the following statuses:</span>
|
||||
<span class="sd"> - 0_STOPPED</span>
|
||||
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
||||
<span class="sd"> - 2_STOP_SAFE</span>
|
||||
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
||||
<span class="sd"> - 4_STARTED</span>
|
||||
<span class="sd"> - 5_STARTED_MANUAL</span>
|
||||
<span class="sd"> - None (if Process instance not exists)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
||||
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">Manual2Auto</span><span class="p">()</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, Ivan Maslov.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||||
|
||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,52 @@
|
||||
####################################
|
||||
6. Defs Managers
|
||||
####################################
|
||||
|
||||
**************************************************
|
||||
Process (General)
|
||||
**************************************************
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# EXAMPLE
|
||||
from pyOpenRPA.Orchestrator import Managers
|
||||
lProcess = Orchestrator.Managers.Process(inAgentHostNameStr="PC-DESKTOP",inAgentUserNameStr="ND", inProcessNameWOExeStr="notepad",inStartCMDStr="notepad")
|
||||
|
||||
|
||||
.. automodule:: pyOpenRPA.Orchestrator.Managers.Process
|
||||
:members:
|
||||
:autosummary:
|
||||
|
||||
|
||||
**************************************************
|
||||
Process (Details)
|
||||
**************************************************
|
||||
|
||||
.. automodule:: pyOpenRPA.Orchestrator.Managers.Process
|
||||
:members:
|
||||
:autosummary:
|
||||
|
||||
|
||||
**************************************************
|
||||
ControlPanel (General)
|
||||
**************************************************
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# EXAMPLE
|
||||
from pyOpenRPA.Orchestrator import Managers
|
||||
lCP = Managers.ControlPanel(inControlPanelNameStr="TestTTT",inRefreshHTMLJinja2TemplatePathStr="ControlPanel\\test.html", inJinja2TemplateRefreshBool = True)
|
||||
|
||||
|
||||
.. automodule:: pyOpenRPA.Orchestrator.Managers.ControlPanel
|
||||
:members:
|
||||
:autosummary:
|
||||
|
||||
|
||||
**************************************************
|
||||
ControlPanel (Details)
|
||||
**************************************************
|
||||
|
||||
.. automodule:: pyOpenRPA.Orchestrator.Managers.ControlPanel
|
||||
:members:
|
||||
:autosummary:
|
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue