Create def to restore Orchestrator session - you can setup this when you want to restoredev-linux
parent
cfe6a70c25
commit
8e7e7f171d
@ -0,0 +1,369 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<!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.Web.Basic — 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>
|
||||||
|
</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.Web.Basic</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.Web.Basic</h1><div class="highlight"><pre>
|
||||||
|
<span></span><span class="kn">import</span> <span class="nn">json</span><span class="o">,</span> <span class="nn">copy</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">__Orchestrator__</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">Processor</span>
|
||||||
|
<span class="c1"># Escape JS to the safe JS for the inline JS in HTML tags ATTENTION! Use it only if want to paste JS into HTML tag - not in <script></span>
|
||||||
|
<span class="c1"># USAGE: JSEscapeForHTMLInline(inJSStr="lTest=\"Hello World\"; alert(\"lTest\")")</span>
|
||||||
|
<span class="k">def</span> <span class="nf">JSEscapeForHTMLInline</span><span class="p">(</span><span class="n">inJSStr</span><span class="p">):</span>
|
||||||
|
<span class="n">lResult</span> <span class="o">=</span> <span class="n">inJSStr</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">"</span><span class="se">\"</span><span class="s2">"</span><span class="p">,</span><span class="s2">"&quot;"</span><span class="p">)</span>
|
||||||
|
<span class="k">return</span> <span class="n">lResult</span>
|
||||||
|
|
||||||
|
<div class="viewcode-block" id="JSProcessorActivityListAdd"><a class="viewcode-back" href="../../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.Web.Basic.JSProcessorActivityListAdd">[docs]</a><span class="k">def</span> <span class="nf">JSProcessorActivityListAdd</span><span class="p">(</span><span class="n">inActivityList</span><span class="p">,</span> <span class="n">inGUIDRemoveBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">):</span>
|
||||||
|
<span class="sd">"""</span>
|
||||||
|
<span class="sd"> # Create JS for send activity list/ activity to the processor</span>
|
||||||
|
<span class="sd"> # USAGE: Orchestrator.Web.Basic.JSProcessorActivityListAdd(inActivityList)</span>
|
||||||
|
|
||||||
|
<span class="sd"> :param inActivityList: List of the activities (See __Orchestrator__.ProcessorActivityItemCreate)</span>
|
||||||
|
<span class="sd"> :param inGUIDRemoveBool: True - remove GUID before generate JS (if GUID is not important)</span>
|
||||||
|
<span class="sd"> :return: JavaScript string for the front end</span>
|
||||||
|
<span class="sd"> """</span>
|
||||||
|
<span class="n">Processor</span><span class="o">.</span><span class="n">__ActivityListVerify__</span><span class="p">(</span><span class="n">inActivityList</span><span class="o">=</span><span class="n">inActivityList</span><span class="p">)</span> <span class="c1"># DO VERIFICATION FOR THE inActivityList</span>
|
||||||
|
<span class="n">inActivityList</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">inActivityList</span><span class="p">)</span>
|
||||||
|
<span class="c1"># Check if no def function is here - if exist - replace to alias</span>
|
||||||
|
<span class="k">for</span> <span class="n">lActivityItem</span> <span class="ow">in</span> <span class="n">inActivityList</span><span class="p">:</span>
|
||||||
|
<span class="k">if</span> <span class="s2">"GUIDStr"</span> <span class="ow">in</span> <span class="n">lActivityItem</span> <span class="ow">and</span> <span class="n">inGUIDRemoveBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> <span class="k">del</span> <span class="n">lActivityItem</span><span class="p">[</span><span class="s2">"GUIDStr"</span><span class="p">]</span> <span class="c1"># Remove GUID from activity items if exists</span>
|
||||||
|
<span class="n">lDef</span> <span class="o">=</span> <span class="n">lActivityItem</span><span class="p">[</span><span class="s2">"Def"</span><span class="p">]</span>
|
||||||
|
<span class="k">if</span> <span class="n">callable</span><span class="p">(</span><span class="n">lDef</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">"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)"</span><span class="p">)</span>
|
||||||
|
<span class="n">lJSStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"""mGlobal.pyOpenRPA.ProcessorQueueAdd(</span><span class="si">{</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">inActivityList</span><span class="p">)</span><span class="si">}</span><span class="s2">);"""</span>
|
||||||
|
<span class="k">return</span> <span class="n">lJSStr</span></div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="viewcode-block" id="JSActivityListExecute"><a class="viewcode-back" href="../../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.Web.Basic.JSActivityListExecute">[docs]</a><span class="k">def</span> <span class="nf">JSActivityListExecute</span><span class="p">(</span><span class="n">inActivityList</span><span class="p">,</span> <span class="n">inGUIDRemoveBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">):</span>
|
||||||
|
<span class="sd">"""</span>
|
||||||
|
<span class="sd"> Create JS for execute activity list/ activity permanent</span>
|
||||||
|
<span class="sd"> USAGE: Orchestrator.Web.Basic.JSActivityListExecute(inActivityList, inGUIDRemoveBool = True)</span>
|
||||||
|
|
||||||
|
<span class="sd"> :param inActivityList: List of the activities (See __Orchestrator__.ProcessorActivityItemCreate)</span>
|
||||||
|
<span class="sd"> :param inGUIDRemoveBool: True - remove GUID before generate JS (if GUID is not important)</span>
|
||||||
|
<span class="sd"> :return: JavaScript string for the front end</span>
|
||||||
|
<span class="sd"> """</span>
|
||||||
|
<span class="n">Processor</span><span class="o">.</span><span class="n">__ActivityListVerify__</span><span class="p">(</span><span class="n">inActivityList</span><span class="o">=</span><span class="n">inActivityList</span><span class="p">)</span> <span class="c1"># DO VERIFICATION FOR THE inActivityList</span>
|
||||||
|
<span class="n">inActivityList</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">inActivityList</span><span class="p">)</span>
|
||||||
|
<span class="c1"># Check if no def function is here - if exist - replace to alias</span>
|
||||||
|
<span class="k">for</span> <span class="n">lActivityItem</span> <span class="ow">in</span> <span class="n">inActivityList</span><span class="p">:</span>
|
||||||
|
<span class="k">if</span> <span class="s2">"GUIDStr"</span> <span class="ow">in</span> <span class="n">lActivityItem</span> <span class="ow">and</span> <span class="n">inGUIDRemoveBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> <span class="k">del</span> <span class="n">lActivityItem</span><span class="p">[</span><span class="s2">"GUIDStr"</span><span class="p">]</span> <span class="c1"># Remove GUID from activity items if exists</span>
|
||||||
|
<span class="n">lDef</span> <span class="o">=</span> <span class="n">lActivityItem</span><span class="p">[</span><span class="s2">"Def"</span><span class="p">]</span>
|
||||||
|
<span class="k">if</span> <span class="n">callable</span><span class="p">(</span><span class="n">lDef</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">"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)"</span><span class="p">)</span>
|
||||||
|
<span class="n">lJSStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"""mGlobal.pyOpenRPA.ActivityListExecute(</span><span class="si">{</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">inActivityList</span><span class="p">)</span><span class="si">}</span><span class="s2">);"""</span>
|
||||||
|
<span class="k">return</span> <span class="n">lJSStr</span></div>
|
||||||
|
|
||||||
|
<span class="c1"># Generate HTML code of the simple URL link by the URL</span>
|
||||||
|
<span class="c1"># USAGE: Orchestrator.Web.Basic.HTMLLinkURL(inURLStr="test",inColorStr="orange")</span>
|
||||||
|
<span class="c1"># USAGE: Basic.HTMLLinkURL(inURLStr="test",inColorStr="orange")</span>
|
||||||
|
<span class="k">def</span> <span class="nf">HTMLLinkURL</span><span class="p">(</span><span class="n">inURLStr</span><span class="p">,</span> <span class="n">inTitleStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inColorStr</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||||
|
<span class="n">lCSSStyleStr</span> <span class="o">=</span> <span class="s2">""</span>
|
||||||
|
<span class="k">if</span> <span class="ow">not</span> <span class="n">inTitleStr</span><span class="p">:</span> <span class="n">inTitleStr</span> <span class="o">=</span> <span class="n">inURLStr</span>
|
||||||
|
<span class="k">if</span> <span class="n">inColorStr</span><span class="p">:</span> <span class="n">lCSSStyleStr</span><span class="o">=</span><span class="sa">f</span><span class="s2">"style=</span><span class="se">\"</span><span class="s2">color:</span><span class="si">{</span><span class="n">inColorStr</span><span class="si">}</span><span class="se">\"</span><span class="s2">"</span>
|
||||||
|
<span class="n">lResult</span><span class="o">=</span><span class="sa">f</span><span class="s2">"<a </span><span class="si">{</span><span class="n">lCSSStyleStr</span><span class="si">}</span><span class="s2"> href=</span><span class="se">\"</span><span class="si">{</span><span class="n">inURLStr</span><span class="si">}</span><span class="se">\"</span><span class="s2">></span><span class="si">{</span><span class="n">inTitleStr</span><span class="si">}</span><span class="s2"></a>"</span>
|
||||||
|
<span class="k">return</span> <span class="n">lResult</span>
|
||||||
|
|
||||||
|
<span class="c1"># Generate HTML code of the simple URL link by the JS when onclick</span>
|
||||||
|
<span class="c1"># USAGE: Orchestrator.Web.Basic.HTMLLinkJSOnClick(inJSOnClickStr="",inColorStr="orange")</span>
|
||||||
|
<span class="c1"># USAGE: Basic.HTMLLinkJSOnClick(inJSOnClickStr="test",inColorStr="orange")</span>
|
||||||
|
<span class="k">def</span> <span class="nf">HTMLLinkJSOnClick</span><span class="p">(</span><span class="n">inJSOnClickStr</span><span class="p">,</span> <span class="n">inTitleStr</span><span class="p">,</span> <span class="n">inColorStr</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||||
|
<span class="n">lCSSStyleStr</span> <span class="o">=</span> <span class="s2">""</span>
|
||||||
|
<span class="k">if</span> <span class="n">inColorStr</span><span class="p">:</span> <span class="n">lCSSStyleStr</span><span class="o">=</span><span class="sa">f</span><span class="s2">"style=</span><span class="se">\"</span><span class="s2">color:</span><span class="si">{</span><span class="n">inColorStr</span><span class="si">}</span><span class="se">\"</span><span class="s2">"</span>
|
||||||
|
<span class="n">inJSOnClickStr</span><span class="o">=</span> <span class="n">JSEscapeForHTMLInline</span><span class="p">(</span><span class="n">inJSStr</span><span class="o">=</span><span class="n">inJSOnClickStr</span><span class="p">)</span> <span class="c1"># Escape some symbols for the inline JS</span>
|
||||||
|
<span class="n">lResult</span><span class="o">=</span><span class="sa">f</span><span class="s2">"<a </span><span class="si">{</span><span class="n">lCSSStyleStr</span><span class="si">}</span><span class="s2"> onclick=</span><span class="se">\"</span><span class="si">{</span><span class="n">inJSOnClickStr</span><span class="si">}</span><span class="se">\"</span><span class="s2">></span><span class="si">{</span><span class="n">inTitleStr</span><span class="si">}</span><span class="s2"></a>"</span>
|
||||||
|
<span class="k">return</span> <span class="n">lResult</span>
|
||||||
|
|
||||||
|
<span class="c1"># Create HTMLLink by the def, argdict, arglist, gsettingsStr, logger Str titleStr, color, (add in processor queue)</span>
|
||||||
|
<span class="k">def</span> <span class="nf">HTMLLinkDefProcessor</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inDef</span><span class="p">,</span> <span class="n">inArgDict</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inArgList</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inArgLoggerStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inLinkTitleStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inLinkColorStr</span><span class="o">=</span><span class="s2">""</span><span class="p">):</span>
|
||||||
|
<span class="n">lDefAliasStr</span> <span class="o">=</span> <span class="n">inDef</span>
|
||||||
|
<span class="k">if</span> <span class="n">callable</span><span class="p">(</span><span class="n">inDef</span><span class="p">):</span>
|
||||||
|
<span class="n">lDefAliasStr</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">inDef</span><span class="p">)</span>
|
||||||
|
<span class="n">lDefAliasStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorAliasDefUpdate</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inDef</span><span class="o">=</span><span class="n">inDef</span><span class="p">,</span> <span class="n">inAliasStr</span><span class="o">=</span><span class="n">lDefAliasStr</span><span class="p">)</span>
|
||||||
|
<span class="k">if</span> <span class="n">inLinkTitleStr</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="n">inLinkTitleStr</span> <span class="o">=</span> <span class="n">lDefAliasStr</span>
|
||||||
|
<span class="n">lActivityList</span> <span class="o">=</span> <span class="p">[</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="n">lDefAliasStr</span><span class="p">,</span><span class="n">inArgList</span><span class="o">=</span><span class="n">inArgList</span><span class="p">,</span><span class="n">inArgDict</span><span class="o">=</span><span class="n">inArgDict</span><span class="p">,</span><span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="n">inArgGSettingsStr</span><span class="p">,</span><span class="n">inArgLoggerStr</span><span class="o">=</span><span class="n">inArgLoggerStr</span><span class="p">)]</span>
|
||||||
|
<span class="n">lJSStr</span> <span class="o">=</span> <span class="n">JSProcessorActivityListAdd</span><span class="p">(</span><span class="n">lActivityList</span><span class="p">)</span>
|
||||||
|
<span class="n">lHTMLStr</span> <span class="o">=</span> <span class="n">HTMLLinkJSOnClick</span><span class="p">(</span><span class="n">inJSOnClickStr</span><span class="o">=</span><span class="n">lJSStr</span><span class="p">,</span><span class="n">inTitleStr</span><span class="o">=</span><span class="n">inLinkTitleStr</span><span class="p">,</span> <span class="n">inColorStr</span><span class="o">=</span><span class="n">inLinkColorStr</span><span class="p">)</span>
|
||||||
|
<span class="k">return</span> <span class="n">lHTMLStr</span>
|
||||||
|
|
||||||
|
<span class="c1"># Create HTMLLink by the def, argdict, arglist, gsettingsStr, logger Str titleStr, color, (execute permanently)</span>
|
||||||
|
<span class="k">def</span> <span class="nf">HTMLLinkDefExecute</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inDef</span><span class="p">,</span> <span class="n">inArgDict</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inArgList</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inArgLoggerStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inLinkTitleStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inLinkColorStr</span><span class="o">=</span><span class="s2">""</span><span class="p">):</span>
|
||||||
|
<span class="n">lDefAliasStr</span> <span class="o">=</span> <span class="n">inDef</span>
|
||||||
|
<span class="k">if</span> <span class="n">callable</span><span class="p">(</span><span class="n">inDef</span><span class="p">):</span>
|
||||||
|
<span class="n">lDefAliasStr</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">inDef</span><span class="p">)</span>
|
||||||
|
<span class="n">lDefAliasStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorAliasDefUpdate</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inDef</span><span class="o">=</span><span class="n">inDef</span><span class="p">,</span> <span class="n">inAliasStr</span><span class="o">=</span><span class="n">lDefAliasStr</span><span class="p">)</span>
|
||||||
|
<span class="k">if</span> <span class="n">inLinkTitleStr</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="n">inLinkTitleStr</span> <span class="o">=</span> <span class="n">lDefAliasStr</span>
|
||||||
|
<span class="n">lActivityList</span> <span class="o">=</span> <span class="p">[</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="n">lDefAliasStr</span><span class="p">,</span><span class="n">inArgList</span><span class="o">=</span><span class="n">inArgList</span><span class="p">,</span><span class="n">inArgDict</span><span class="o">=</span><span class="n">inArgDict</span><span class="p">,</span><span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="n">inArgGSettingsStr</span><span class="p">,</span><span class="n">inArgLoggerStr</span><span class="o">=</span><span class="n">inArgLoggerStr</span><span class="p">)]</span>
|
||||||
|
<span class="n">lJSStr</span> <span class="o">=</span> <span class="n">JSActivityListExecute</span><span class="p">(</span><span class="n">lActivityList</span><span class="p">)</span>
|
||||||
|
<span class="n">lHTMLStr</span> <span class="o">=</span> <span class="n">HTMLLinkJSOnClick</span><span class="p">(</span><span class="n">inJSOnClickStr</span><span class="o">=</span><span class="n">lJSStr</span><span class="p">,</span><span class="n">inTitleStr</span><span class="o">=</span><span class="n">inLinkTitleStr</span><span class="p">,</span> <span class="n">inColorStr</span><span class="o">=</span><span class="n">inLinkColorStr</span><span class="p">)</span>
|
||||||
|
<span class="k">return</span> <span class="n">lHTMLStr</span>
|
||||||
|
|
||||||
|
<span class="c1"># HTML Generator for the CP up to v.1.2.0</span>
|
||||||
|
<span class="k">def</span> <span class="nf">HTMLControlPanelBC</span><span class="p">(</span><span class="n">inCPDict</span><span class="p">):</span>
|
||||||
|
<span class="c1"># FooterButtonX2List generation</span>
|
||||||
|
<span class="n">lFooterButtonX2Str</span> <span class="o">=</span> <span class="s2">""</span>
|
||||||
|
<span class="k">for</span> <span class="n">lItem</span> <span class="ow">in</span> <span class="n">inCPDict</span><span class="p">[</span><span class="s2">"FooterButtonX2List"</span><span class="p">]:</span>
|
||||||
|
<span class="n">lFooterButtonX2Str</span><span class="o">+=</span><span class="sa">f</span><span class="s1">'<div class="ui basic </span><span class="si">{</span><span class="n">lItem</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"Color"</span><span class="p">,</span><span class="s2">""</span><span class="p">)</span><span class="si">}</span><span class="s1"> button" onclick="</span><span class="si">{</span><span class="n">JSEscapeForHTMLInline</span><span class="p">(</span><span class="n">lItem</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"OnClick"</span><span class="p">,</span><span class="s2">""</span><span class="p">))</span><span class="si">}</span><span class="s1">"></span><span class="si">{</span><span class="n">lItem</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"Text"</span><span class="p">,</span><span class="s2">""</span><span class="p">)</span><span class="si">}</span><span class="s1"></div>'</span>
|
||||||
|
<span class="c1"># FooterButtonX1List generation</span>
|
||||||
|
<span class="n">lFooterButtonX1Str</span> <span class="o">=</span> <span class="s2">""</span>
|
||||||
|
<span class="k">for</span> <span class="n">lItem</span> <span class="ow">in</span> <span class="n">inCPDict</span><span class="p">[</span><span class="s2">"FooterButtonX1List"</span><span class="p">]:</span>
|
||||||
|
<span class="n">lFooterButtonX1Str</span><span class="o">+=</span><span class="sa">f</span><span class="s1">'<div class="ui basic </span><span class="si">{</span><span class="n">lItem</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"Color"</span><span class="p">,</span><span class="s2">""</span><span class="p">)</span><span class="si">}</span><span class="s1"> button" onclick="</span><span class="si">{</span><span class="n">JSEscapeForHTMLInline</span><span class="p">(</span><span class="n">lItem</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"OnClick"</span><span class="p">,</span><span class="s2">""</span><span class="p">))</span><span class="si">}</span><span class="s1">"></span><span class="si">{</span><span class="n">lItem</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"Text"</span><span class="p">,</span><span class="s2">""</span><span class="p">)</span><span class="si">}</span><span class="s1"></div>'</span>
|
||||||
|
<span class="c1"># BodyKeyValue generation</span>
|
||||||
|
<span class="n">lBodyKeyValueStr</span> <span class="o">=</span> <span class="s2">""</span>
|
||||||
|
<span class="k">for</span> <span class="n">lItem</span> <span class="ow">in</span> <span class="n">inCPDict</span><span class="p">[</span><span class="s2">"BodyKeyValueList"</span><span class="p">]:</span>
|
||||||
|
<span class="n">lBodyKeyValueStr</span><span class="o">+=</span><span class="sa">f</span><span class="s2">"<li></span><span class="si">{</span><span class="n">lItem</span><span class="p">[</span><span class="s1">'Key'</span><span class="p">]</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">lItem</span><span class="p">[</span><span class="s1">'Value'</span><span class="p">]</span><span class="si">}</span><span class="s2"></li>"</span>
|
||||||
|
<span class="c1"># Generate consolidated string</span>
|
||||||
|
<span class="n">lResultHTMLStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"""</span>
|
||||||
|
<span class="s2"> <div class="card"></span>
|
||||||
|
<span class="s2"> <div class="content"></span>
|
||||||
|
<span class="s2"> <div class="right floated mini ui "></span>
|
||||||
|
<span class="s2"> </span><span class="si">{</span><span class="n">inCPDict</span><span class="p">[</span><span class="s1">'HeaderRightText'</span><span class="p">]</span><span class="si">}</span><span class="s2"></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> <div class="header"></span>
|
||||||
|
<span class="s2"> </span><span class="si">{</span><span class="n">inCPDict</span><span class="p">[</span><span class="s1">'HeaderLeftText'</span><span class="p">]</span><span class="si">}</span><span class="s2"></span>
|
||||||
|
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> <div class="meta"></span>
|
||||||
|
<span class="s2"> </span><span class="si">{</span><span class="n">inCPDict</span><span class="p">[</span><span class="s1">'SubheaderText'</span><span class="p">]</span><span class="si">}</span><span class="s2"></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> <div class="description"></span>
|
||||||
|
<span class="s2"> <ul style="padding-inline-start:16px;margin:0px"></span>
|
||||||
|
<span class="s2"> </span><span class="si">{</span><span class="n">lBodyKeyValueStr</span><span class="si">}</span><span class="s2"></span>
|
||||||
|
<span class="s2"> </ul></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> <div class="extra content"></span>
|
||||||
|
<span class="s2"> </span><span class="si">{</span><span class="n">inCPDict</span><span class="p">[</span><span class="s1">'FooterText'</span><span class="p">]</span><span class="si">}</span><span class="s2"></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> <div class="extra content"></span>
|
||||||
|
<span class="s2"> <div class="ui two buttons"></span>
|
||||||
|
<span class="s2"> </span><span class="si">{</span><span class="n">lFooterButtonX2Str</span><span class="si">}</span><span class="s2"></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> <div class="ui horizontal divider">Add. controls</div></span>
|
||||||
|
<span class="s2"> <div class="ui one buttons"></span>
|
||||||
|
<span class="s2"> </span><span class="si">{</span><span class="n">lFooterButtonX1Str</span><span class="si">}</span><span class="s2"></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> </div></span>
|
||||||
|
<span class="s2"> """</span>
|
||||||
|
|
||||||
|
<span class="k">return</span> <span class="n">lResultHTMLStr</span>
|
||||||
|
</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>
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue