You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Wiki/ENG_Guide/html/Orchestrator/gSettingsTemplate.html

584 lines
46 KiB

<!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>gSettings Template &mdash; 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" />
<!--[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" />
<link rel="prev" title="Description" href="Orchestrator.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">ROBOT</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Robot/Robot.html">Description</a></li>
</ul>
<p class="caption"><span class="caption-text">STUDIO</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Studio/Studio.html">Description</a></li>
</ul>
<p class="caption"><span class="caption-text">ORCHESTRATOR</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="HowToStart.html">How to start</a></li>
<li class="toctree-l1"><a class="reference internal" href="Orchestrator.html">Description</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">gSettings Template</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> &raquo;</li>
<li>gSettings Template</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/Orchestrator/gSettingsTemplate.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="gsettings-template">
<h1>gSettings Template<a class="headerlink" href="#gsettings-template" title="Permalink to this headline"></a></h1>
<p>gSettings structure</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">logging</span><span class="o">,</span> <span class="nn">datetime</span><span class="o">,</span> <span class="nn">sys</span>
<span class="c1"># Technical def - return GSettings structure with examples</span>
<span class="k">def</span> <span class="nf">__Create__</span><span class="p">():</span>
<span class="k">return</span> <span class="p">{</span>
<span class="s2">&quot;VersionStr&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Will be filled in orchestrator,</span>
<span class="s2">&quot;Autocleaner&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings</span>
<span class="s2">&quot;IntervalSecFloat&quot;</span><span class="p">:</span> <span class="mf">600.0</span><span class="p">,</span> <span class="c1"># Sec float to periodically clear gsettings</span>
<span class="p">},</span>
<span class="s2">&quot;Client&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Settings about client web orchestrator</span>
<span class="s2">&quot;Session&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># Settings about web session. Session algorythms works only for special requests (URL in ServerSettings)</span>
<span class="s2">&quot;LifetimeSecFloat&quot;</span><span class="p">:</span> <span class="mf">600.0</span><span class="p">,</span>
<span class="c1"># Client Session lifetime in seconds. after this time server will forget about this client session</span>
<span class="s2">&quot;LifetimeRequestSecFloat&quot;</span><span class="p">:</span> <span class="mf">120.0</span><span class="p">,</span> <span class="c1"># 1 client request lifetime in server in seconds</span>
<span class="s2">&quot;ControlPanelRefreshIntervalSecFloat&quot;</span><span class="p">:</span> <span class="mf">1.5</span><span class="p">,</span> <span class="c1"># Interval to refresh control panels for session,</span>
<span class="s2">&quot;TechnicalSessionGUIDCache&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># TEchnical cache. Fills when web browser is requesting</span>
<span class="c1"># &quot;SessionGUIDStr&quot;:{ # Session with some GUID str. On client session guid stored in cookie &quot;SessionGUIDStr&quot;</span>
<span class="c1"># &quot;InitDatetime&quot;: None, # Datetime when session GUID was created</span>
<span class="c1"># &quot;DatasetLast&quot;: {</span>
<span class="c1"># &quot;ControlPanel&quot;: {</span>
<span class="c1"># &quot;Data&quot;: None, # Struct to check with new iterations. None if starts</span>
<span class="c1"># &quot;ReturnBool&quot;: False # flag to return, close request and return data as json</span>
<span class="c1"># }</span>
<span class="c1"># },</span>
<span class="c1"># &quot;ClientRequestHandler&quot;: None, # Last client request handler</span>
<span class="c1"># &quot;UserADStr&quot;: None, # User, who connect. None if user is not exists</span>
<span class="c1"># &quot;DomainADStr&quot;: None, # Domain of the user who connect. None if user is not exists</span>
<span class="c1"># }</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="c1"># # # # # # Client... # # # # # # # #</span>
<span class="s2">&quot;DumpLogListRefreshIntervalSecFloat&quot;</span><span class="p">:</span> <span class="mf">3.0</span><span class="p">,</span> <span class="c1"># Duration between updates for the Client</span>
<span class="s2">&quot;DumpLogListCountInt&quot;</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span> <span class="c1"># Set the max row for the dump</span>
<span class="s2">&quot;DumpLogList&quot;</span><span class="p">:</span> <span class="p">[],</span> <span class="c1"># Will be filled automatically</span>
<span class="s2">&quot;DumpLogListHashStr&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Will be filled automatically</span>
<span class="c1"># # # # # # # # # # # # # # # # # #</span>
<span class="p">},</span>
<span class="s2">&quot;ServerDict&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;WorkingDirectoryPathStr&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Will be filled automatically</span>
<span class="s2">&quot;RequestTimeoutSecFloat&quot;</span><span class="p">:</span> <span class="mi">300</span><span class="p">,</span> <span class="c1"># Time to handle request in seconds</span>
<span class="s2">&quot;ListenPort_&quot;</span><span class="p">:</span> <span class="s2">&quot;Порт, по которому можно подключиться к демону&quot;</span><span class="p">,</span>
<span class="s2">&quot;ListenPort&quot;</span><span class="p">:</span> <span class="mi">80</span><span class="p">,</span>
<span class="s2">&quot;ListenURLList&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;Description&quot;</span><span class="p">:</span> <span class="s2">&quot;Local machine test&quot;</span><span class="p">,</span>
<span class="s2">&quot;URL_&quot;</span><span class="p">:</span> <span class="s2">&quot;Сетевое расположение сервера демона&quot;</span><span class="p">,</span>
<span class="s2">&quot;URL&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;AccessUsers&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Default - all URL is blocked</span>
<span class="s2">&quot;FlagCredentialsAsk&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Turn on Authentication</span>
<span class="s2">&quot;RuleDomainUserDict&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># (&quot;DOMAIN&quot;, &quot;USER&quot;): { !!!!! only in upper case !!!!</span>
<span class="c1"># &quot;MethodMatchURLBeforeList&quot;: [</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Method&quot;:&quot;GET|POST&quot;,</span>
<span class="c1"># &quot;MatchType&quot;:&quot;BeginWith|Contains|Equal|EqualCase&quot;,</span>
<span class="c1"># &quot;URL&quot;:&quot;&quot;,</span>
<span class="c1"># &quot;FlagAccessDefRequestGlobalAuthenticate&quot;: None, #Return bool</span>
<span class="c1"># &quot;FlagAccess&quot;: True</span>
<span class="c1"># }</span>
<span class="c1"># ],</span>
<span class="c1"># &quot;ControlPanelKeyAllowedList&quot;:[], # If empty - all is allowed</span>
<span class="c1"># &quot;RoleHierarchyAllowedDict&quot;: {</span>
<span class="c1"># &quot;Orchestrator&quot;:{</span>
<span class="c1"># &quot;Controls&quot;: {</span>
<span class="c1"># &quot;RestartOrchestrator&quot;: {}, # Feature to restart orchestrator on virtual machine</span>
<span class="c1"># &quot;LookMachineScreenshots&quot;: {} # Feature to look machina screenshots</span>
<span class="c1"># },</span>
<span class="c1"># &quot;RDPActive&quot;: { # Robot RDP active module</span>
<span class="c1"># &quot;ListRead&quot;: {} # Access to read RDP session list</span>
<span class="c1"># }</span>
<span class="c1"># }</span>
<span class="c1"># }</span>
<span class="c1"># }</span>
<span class="p">},</span>
<span class="s2">&quot;RuleMethodMatchURLBeforeList&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="c1"># General MethodMatchURL list (no domain/user)</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Method&quot;:&quot;GET|POST&quot;,</span>
<span class="c1"># &quot;MatchType&quot;:&quot;BeginWith|Contains|Equal|EqualCase&quot;,</span>
<span class="c1"># &quot;URL&quot;:&quot;&quot;,</span>
<span class="c1"># &quot;FlagAccessDefRequestGlobalAuthenticate&quot;: None, #Return bool</span>
<span class="c1"># &quot;FlagAccess&quot;: True</span>
<span class="c1"># }</span>
<span class="p">],</span>
<span class="s2">&quot;AuthTokensDict&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># &quot;&lt;AuthToken&gt;&quot;:{&quot;User&quot;:&quot;&quot;, &quot;Domain&quot;:&quot;&quot;, &quot;TokenDatetime&quot;:&lt;Datetime&gt;, &quot;FlagDoNotExpire&quot;:True}</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="s2">&quot;URLList&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="c1"># List of available URLs with the orchestrator server</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Method&quot;:&quot;GET|POST&quot;,</span>
<span class="c1"># &quot;URL&quot;: &quot;/index&quot;, #URL of the request</span>
<span class="c1"># &quot;MatchType&quot;: &quot;&quot;, #&quot;BeginWith|Contains|Equal|EqualCase&quot;,</span>
<span class="c1"># &quot;ResponseFilePath&quot;: &quot;&quot;, #Absolute or relative path</span>
<span class="c1"># &quot;ResponseFolderPath&quot;: &quot;&quot;, #Absolute or relative path</span>
<span class="c1"># &quot;ResponseContentType&quot;: &quot;&quot;, #HTTP Content-type</span>
<span class="c1"># &quot;ResponseDefRequestGlobal&quot;: None #Function with str result</span>
<span class="c1"># }</span>
<span class="p">{</span>
<span class="s2">&quot;Method&quot;</span><span class="p">:</span> <span class="s2">&quot;GET&quot;</span><span class="p">,</span>
<span class="s2">&quot;URL&quot;</span><span class="p">:</span> <span class="s2">&quot;/test/&quot;</span><span class="p">,</span> <span class="c1"># URL of the request</span>
<span class="s2">&quot;MatchType&quot;</span><span class="p">:</span> <span class="s2">&quot;BeginWith&quot;</span><span class="p">,</span> <span class="c1"># &quot;BeginWith|Contains|Equal|EqualCase&quot;,</span>
<span class="c1"># &quot;ResponseFilePath&quot;: &quot;&quot;, #Absolute or relative path</span>
<span class="s2">&quot;ResponseFolderPath&quot;</span><span class="p">:</span> <span class="s2">&quot;C:\Abs\Archive\scopeSrcUL\OpenRPA\Orchestrator\Settings&quot;</span><span class="p">,</span>
<span class="c1"># Absolute or relative path</span>
<span class="c1"># &quot;ResponseContentType&quot;: &quot;&quot;, #HTTP Content-type</span>
<span class="c1"># &quot;ResponseDefRequestGlobal&quot;: None #Function with str result</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="p">},</span>
<span class="s2">&quot;OrchestratorStart&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;DefSettingsUpdatePathList&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="c1"># List of the .py files which should be loaded before init the algorythms</span>
<span class="s2">&quot;ActivityList&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;ProcessStop&quot;, #Activity type</span>
<span class="c1"># &quot;Name&quot;: &quot;OpenRPARobotDaemon.exe&quot;, #Process name</span>
<span class="c1"># &quot;FlagForce&quot;: True, #Force process close</span>
<span class="c1"># &quot;User&quot;: &quot;%username%&quot; #Empty, user or %username%</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;ProcessStartIfTurnedOff&quot;, #Activity type</span>
<span class="c1"># &quot;CheckTaskName&quot;: &quot;notepad.exe&quot;, #Python function module name</span>
<span class="c1"># &quot;Path&quot;: &quot;notepad&quot;, #Python function name</span>
<span class="c1"># &quot;ArgList&quot;: [] #Input python function args</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;RDPSessionConnect&quot;, #Activity type - start/connect RDP Session</span>
<span class="c1"># &quot;RDPSessionKeyStr&quot;: &quot;notepad.exe&quot;, #Python function module name</span>
<span class="c1"># &quot;RDPConfigurationDict&quot;: {}</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;RDPSessionLogoff&quot;, #Activity type - logoff RDP Session</span>
<span class="c1"># &quot;RDPSessionKeyStr&quot;: &quot;notepad.exe&quot;, #Python function module name</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;RDPSessionDisconnect&quot;, #Activity type - disconnect the RDP Session without logoff</span>
<span class="c1"># &quot;RDPSessionKeyStr&quot;: &quot;notepad.exe&quot;, #Python function module name</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;RDPSessionFileSend&quot;, #Activity type - send file to RDP session</span>
<span class="c1"># ...</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;RDPSessionFileRecieve&quot;, #Activity type - recieve file from rdp session</span>
<span class="c1"># ...</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;RDPSessionProcessStart&quot;, #Activity type -</span>
<span class="c1"># ...</span>
<span class="c1"># },</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="s2">&quot;SchedulerDict&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;CheckIntervalSecFloat&quot;</span><span class="p">:</span> <span class="mf">5.0</span><span class="p">,</span> <span class="c1"># Check interval in seconds</span>
<span class="s2">&quot;ActivityTimeList&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="c1"># {</span>
<span class="c1"># &quot;TimeHH:MMStr&quot;: &quot;22:23&quot;, # Time [HH:MM] to trigger activity</span>
<span class="c1"># &quot;WeekdayList&quot;: [0, 1, 2, 3, 4, 5, 6], #List of the weekday index when activity is applicable, Default [0,1,2,3,4,5,6]</span>
<span class="c1"># &quot;ActivityList&quot;: [</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Type&quot;: &quot;ProcessStart&quot;, # Activity type</span>
<span class="c1"># &quot;Path&quot;: &quot;start&quot;, # Executable file path</span>
<span class="c1"># &quot;ArgList&quot;: [&quot;cmd.exe&quot;, &quot;/c&quot;, &quot;PIPUpgrade.cmd&quot;] # List of the arguments</span>
<span class="c1"># }</span>
<span class="c1"># ],</span>
<span class="c1"># &quot;GUID&quot;: None # Will be filled in Orchestrator automatically - is needed for detect activity completion</span>
<span class="c1"># },</span>
<span class="p">],</span>
<span class="p">},</span>
<span class="s2">&quot;ProcessorDict&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Has been changed. New general processor (one threaded) v.1.2.0</span>
<span class="s2">&quot;ActivityList&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="c1"># List of the activities</span>
<span class="c1"># {</span>
<span class="c1"># &quot;Def&quot;:&quot;DefAliasTest&quot;, # def link or def alias (look gSettings[&quot;Processor&quot;][&quot;AliasDefDict&quot;])</span>
<span class="c1"># &quot;ArgList&quot;:[1,2,3], # Args list</span>
<span class="c1"># &quot;ArgDict&quot;:{&quot;ttt&quot;:1,&quot;222&quot;:2,&quot;dsd&quot;:3} # Args dictionary</span>
<span class="c1"># &quot;ArgGSettings&quot;: # Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<span class="c1"># &quot;ArgLogger&quot;: None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<span class="c1"># },</span>
<span class="p">],</span>
<span class="s2">&quot;AliasDefDict&quot;</span><span class="p">:</span> <span class="p">{},</span> <span class="c1"># Storage for def with Str alias. To use it see pyOpenRPA.Orchestrator.ControlPanel</span>
<span class="s2">&quot;CheckIntervalSecFloat&quot;</span><span class="p">:</span> <span class="mf">1.0</span><span class="p">,</span> <span class="c1"># Interval for check gSettings in ProcessorDict &gt; ActivityList</span>
<span class="s2">&quot;ExecuteBool&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Flag to execute thread processor</span>
<span class="s2">&quot;ThreadIdInt&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Technical field - will be setup when processor init</span>
<span class="p">},</span>
<span class="s2">&quot;ControlPanelDict&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Old structure &gt; CPDict</span>
<span class="s2">&quot;RefreshSeconds&quot;</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span> <span class="c1"># deprecated parameter</span>
<span class="s2">&quot;RobotList&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="c1">#{</span>
<span class="c1"># &quot;RenderFunction&quot;: RenderRobotR01,</span>
<span class="c1"># &quot;KeyStr&quot;: &quot;TestControlPanelKey&quot;</span>
<span class="c1">#}</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="s2">&quot;CPDict&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># &quot;CPKey&quot;: {&quot;HTMLRenderDef&quot;:None, &quot;JSONGeneratorDef&quot;:None, &quot;JSInitGeneratorDef&quot;:None}</span>
<span class="p">},</span>
<span class="c1"># # # # # # # # # # # # # #</span>
<span class="s2">&quot;RobotRDPActive&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;RDPList&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># &quot;RDPSessionKey&quot;:{</span>
<span class="c1"># &quot;Host&quot;: &quot;77.77.22.22&quot;, # Host address</span>
<span class="c1"># &quot;Port&quot;: &quot;3389&quot;, # RDP Port</span>
<span class="c1"># &quot;Login&quot;: &quot;test&quot;, # Login</span>
<span class="c1"># &quot;Password&quot;: &quot;test&quot;, # Password</span>
<span class="c1"># &quot;Screen&quot;: {</span>
<span class="c1"># &quot;Width&quot;: 1680, # Width of the remote desktop in pixels</span>
<span class="c1"># &quot;Height&quot;: 1050, # Height of the remote desktop in pixels</span>
<span class="c1"># # &quot;640x480&quot; or &quot;1680x1050&quot; or &quot;FullScreen&quot;. If Resolution not exists set full screen</span>
<span class="c1"># &quot;FlagUseAllMonitors&quot;: False, # True or False</span>
<span class="c1"># &quot;DepthBit&quot;: &quot;32&quot; # &quot;32&quot; or &quot;24&quot; or &quot;16&quot; or &quot;15&quot;</span>
<span class="c1"># },</span>
<span class="c1"># &quot;SharedDriveList&quot;: [&quot;c&quot;], # List of the Root sesion hard drives</span>
<span class="c1"># ###### Will updated in program ############</span>
<span class="c1"># &quot;SessionHex&quot;: &quot;&quot;, # Hex is created when robot runs</span>
<span class="c1"># &quot;SessionIsWindowExistBool&quot;: False, # Flag if the RDP window is exist, old name &quot;FlagSessionIsActive&quot;. Check every n seconds</span>
<span class="c1"># &quot;SessionIsWindowResponsibleBool&quot;: False, # Flag if RDP window is responsible (recieve commands). Check every nn seconds. If window is Responsible - window is Exist too</span>
<span class="c1"># &quot;SessionIsIgnoredBool&quot;: False # Flag to ignore RDP window False - dont ignore, True - ignore</span>
<span class="c1"># }</span>
<span class="p">},</span>
<span class="s2">&quot;ResponsibilityCheckIntervalSec&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="c1"># Seconds interval when Robot check the RDP responsibility. if None - dont check</span>
<span class="s2">&quot;FullScreenRDPSessionKeyStr&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="c1"># RDPSessionKeyStr of the current session which is full screened, None is no session in fullscreen</span>
<span class="s2">&quot;ActivityList&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="c1"># Technical Activity list for RobotRDPActive thread - equal to Main activity list, apply only RDP activity</span>
<span class="c1"># {</span>
<span class="c1"># &quot;DefNameStr&quot;:&quot;test&quot;, # Function name in RobotRDPActive.Processor</span>
<span class="c1"># &quot;ArgList&quot;:[1,2,3], # Args list</span>
<span class="c1"># &quot;ArgDict&quot;:{&quot;ttt&quot;:1,&quot;222&quot;:2,&quot;dsd&quot;:3} # Args dictionary</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;DefNameStr&quot;: &quot;RDPSessionConnect&quot;, # Function name in RobotRDPActive.Processor</span>
<span class="c1"># &quot;ArgList&quot;: [], # Args list</span>
<span class="c1"># &quot;ArgDict&quot;: {&quot;inRDPSessionKeyStr&quot;: &quot;TestRDP&quot;, &quot;inHostStr&quot;: &quot;77.44.33.22&quot;, &quot;inPortStr&quot;: &quot;3389&quot;,</span>
<span class="c1"># &quot;inLoginStr&quot;: &quot;login&quot;, &quot;inPasswordStr&quot;: &quot;pass&quot;} # Args dictionary</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;DefNameStr&quot;: &quot;RDPSessionDisconnect&quot;, # Disconnect the RDP session without logoff. Function name in RobotRDPActive.Processor</span>
<span class="c1"># &quot;ArgList&quot;: [], # Args list</span>
<span class="c1"># &quot;ArgDict&quot;: {&quot;inRDPSessionKeyStr&quot;: &quot;TestRDP&quot;}</span>
<span class="c1"># },</span>
<span class="c1"># {</span>
<span class="c1"># &quot;DefNameStr&quot;: &quot;RDPSessionReconnect&quot;, # Disconnect the RDP session without logoff. Function name in RobotRDPActive.Processor</span>
<span class="c1"># &quot;ArgList&quot;: [], # Args list</span>
<span class="c1"># &quot;ArgDict&quot;: {&quot;inRDPSessionKeyStr&quot;: &quot;TestRDP&quot;}</span>
<span class="c1"># }</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="c1"># # # # # # # # # # # # # #</span>
<span class="s2">&quot;FileManager&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;FileURLFilePathDict_help&quot;</span><span class="p">:</span> <span class="s2">&quot;https://localhost:8081/filemanager/&lt;file URL&gt;. All FileURL s must be set in lowercase&quot;</span><span class="p">,</span>
<span class="s2">&quot;FileURLFilePathDict&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="c1">#&quot;r01/report.xlsx&quot;: &quot;C:\\RPA\\R01_IntegrationOrderOut\\Data\\Reestr_otgruzok.xlsx&quot;</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="s2">&quot;Logger&quot;</span><span class="p">:</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;Orchestrator&quot;</span><span class="p">),</span>
<span class="s2">&quot;Storage&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;Robot_R01_help&quot;</span><span class="p">:</span> <span class="s2">&quot;Robot data storage in orchestrator env&quot;</span><span class="p">,</span>
<span class="s2">&quot;Robot_R01&quot;</span><span class="p">:</span> <span class="p">{},</span>
<span class="s2">&quot;R01_OrchestratorToRobot&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;Test2&quot;</span><span class="p">:</span> <span class="s2">&quot;Test2&quot;</span><span class="p">}</span>
<span class="p">},</span>
<span class="s2">&quot;AgentDict&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Will be filled when program runs</span>
<span class="c1">#(&quot;HostNameUpperStr&quot;, &quot;UserUpperStr&quot;): { &quot;IsListenBool&quot;: True, &quot;QueueList&quot;: [] }</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="c1"># Create full configuration for</span>
<span class="k">def</span> <span class="nf">__AgentDictItemCreate__</span><span class="p">():</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;IsListenBool&quot;</span><span class="p">:</span><span class="kc">False</span><span class="p">,</span> <span class="s2">&quot;ConnectionCountInt&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;ConnectionFirstQueueItemCountInt&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;ActivityList&quot;</span><span class="p">:[]}</span>
<span class="c1"># Create full configuration for</span>
<span class="k">def</span> <span class="nf">__UACClientAdminCreate__</span><span class="p">():</span>
<span class="n">lResultDict</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;pyOpenRPADict&quot;</span><span class="p">:{</span>
<span class="s2">&quot;CPKeyDict&quot;</span><span class="p">:{</span> <span class="c1"># Empty dict - all access</span>
<span class="c1"># &quot;CPKeyStr&quot;{</span>
<span class="c1"># }</span>
<span class="p">},</span>
<span class="s2">&quot;RDPKeyDict&quot;</span><span class="p">:{</span> <span class="c1"># Empty dict - all access</span>
<span class="c1">#&quot;RDPKeyStr&quot;{</span>
<span class="c1"># &quot;FullscreenBool&quot;: True,</span>
<span class="c1"># &quot;IgnoreBool&quot;:True,</span>
<span class="c1"># &quot;ReconnectBool&quot;: True</span>
<span class="c1"># &quot;NothingBool&quot;: True # USe option if you dont want to give some access to the RDP controls</span>
<span class="c1"># }</span>
<span class="p">},</span>
<span class="s2">&quot;AgentKeyDict&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Empty dict - all access</span>
<span class="c1"># &quot;AgentKeyStr&quot;{</span>
<span class="c1"># }</span>
<span class="p">},</span>
<span class="s2">&quot;AdminDict&quot;</span><span class="p">:{</span> <span class="c1"># Empty dict - all access</span>
<span class="s2">&quot;LogViewerBool&quot;</span><span class="p">:</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># Show log viewer on the web page</span>
<span class="s2">&quot;CMDInputBool&quot;</span><span class="p">:</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># Execute CMD on the server side and result to the logs</span>
<span class="s2">&quot;ScreenshotViewerBool&quot;</span><span class="p">:</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># Show button to look screenshots</span>
<span class="s2">&quot;RestartOrchestratorBool&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Restart orchestrator activity</span>
<span class="s2">&quot;RestartOrchestratorGITPullBool&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Turn off (RDP remember) orc + git pull + Turn on (rdp remember)</span>
<span class="s2">&quot;RestartPCBool&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Send CMD to restart pc</span>
<span class="s2">&quot;NothingBool&quot;</span><span class="p">:</span><span class="kc">True</span> <span class="c1"># USe option if you dont want to give some access to the RDP controls</span>
<span class="p">},</span>
<span class="s2">&quot;ActivityDict&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Empty dict - all access</span>
<span class="s2">&quot;ActivityListExecuteBool&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Execute activity at the current thread</span>
<span class="s2">&quot;ActivityListAppendProcessorQueueBool&quot;</span><span class="p">:</span> <span class="kc">True</span> <span class="c1"># Append activity to the processor queue</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">lResultDict</span>
<span class="c1"># Init the log dump to WEB</span>
<span class="c1"># import pdb; pdb.set_trace()</span>
<span class="c1">############################################</span>
<span class="k">def</span> <span class="nf">LoggerDumpLogHandlerAdd</span><span class="p">(</span><span class="n">inLogger</span><span class="p">,</span> <span class="n">inGSettingsClientDict</span><span class="p">):</span>
<span class="n">lL</span> <span class="o">=</span> <span class="n">inLogger</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">lL</span><span class="o">.</span><span class="n">handlers</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">mRobotLoggerFormatter</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">Formatter</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%(asctime)s</span><span class="s1"> - </span><span class="si">%(levelname)s</span><span class="s1"> - </span><span class="si">%(message)s</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">mRobotLoggerFormatter</span> <span class="o">=</span> <span class="n">lL</span><span class="o">.</span><span class="n">handlers</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">formatter</span>
<span class="n">mHandlerDumpLogList</span> <span class="o">=</span> <span class="n">LoggerHandlerDumpLogList</span><span class="o">.</span><span class="n">LoggerHandlerDumpLogList</span><span class="p">(</span><span class="n">inDict</span><span class="o">=</span><span class="n">inGSettingsClientDict</span><span class="p">,</span>
<span class="n">inKeyStr</span><span class="o">=</span><span class="s2">&quot;DumpLogList&quot;</span><span class="p">,</span> <span class="n">inHashKeyStr</span><span class="o">=</span><span class="s2">&quot;DumpLogListHashStr&quot;</span><span class="p">,</span> <span class="n">inRowCountInt</span><span class="o">=</span><span class="n">inGSettingsClientDict</span><span class="p">[</span>
<span class="s2">&quot;DumpLogListCountInt&quot;</span><span class="p">])</span>
<span class="n">mHandlerDumpLogList</span><span class="o">.</span><span class="n">setFormatter</span><span class="p">(</span><span class="n">mRobotLoggerFormatter</span><span class="p">)</span>
<span class="n">lL</span><span class="o">.</span><span class="n">addHandler</span><span class="p">(</span><span class="n">mHandlerDumpLogList</span><span class="p">)</span>
<span class="c1"># inModeStr:</span>
<span class="c1"># &quot;BASIC&quot; - create standart configuration</span>
<span class="kn">from</span> <span class="nn">pyOpenRPA.Orchestrator.Utils</span> <span class="kn">import</span> <span class="n">LoggerHandlerDumpLogList</span>
<span class="k">def</span> <span class="nf">Create</span><span class="p">(</span><span class="n">inModeStr</span><span class="o">=</span><span class="s2">&quot;BASIC&quot;</span><span class="p">):</span>
<span class="k">if</span> <span class="n">inModeStr</span><span class="o">==</span><span class="s2">&quot;BASIC&quot;</span><span class="p">:</span>
<span class="n">lResult</span> <span class="o">=</span> <span class="n">__Create__</span><span class="p">()</span> <span class="c1"># Create settings</span>
<span class="c1"># Создать файл логирования</span>
<span class="c1"># add filemode=&quot;w&quot; to overwrite</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">&quot;Reports&quot;</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="s2">&quot;Reports&quot;</span><span class="p">)</span>
<span class="c1">##########################</span>
<span class="c1"># Подготовка логгера Robot</span>
<span class="c1">#########################</span>
<span class="n">mRobotLogger</span> <span class="o">=</span> <span class="n">lResult</span><span class="p">[</span><span class="s2">&quot;Logger&quot;</span><span class="p">]</span>
<span class="n">mRobotLogger</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span>
<span class="c1"># create the logging file handler</span>
<span class="n">mRobotLoggerFH</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">FileHandler</span><span class="p">(</span>
<span class="s2">&quot;Reports</span><span class="se">\\</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">&quot;%Y_%m_</span><span class="si">%d</span><span class="s2">&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;.log&quot;</span><span class="p">)</span>
<span class="n">mRobotLoggerFormatter</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">Formatter</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%(asctime)s</span><span class="s1"> - </span><span class="si">%(levelname)s</span><span class="s1"> - </span><span class="si">%(message)s</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="n">mRobotLoggerFH</span><span class="o">.</span><span class="n">setFormatter</span><span class="p">(</span><span class="n">mRobotLoggerFormatter</span><span class="p">)</span>
<span class="c1"># add handler to logger object</span>
<span class="n">mRobotLogger</span><span class="o">.</span><span class="n">addHandler</span><span class="p">(</span><span class="n">mRobotLoggerFH</span><span class="p">)</span>
<span class="c1">####################Add console output</span>
<span class="n">handler</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">StreamHandler</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">setFormatter</span><span class="p">(</span><span class="n">mRobotLoggerFormatter</span><span class="p">)</span>
<span class="n">mRobotLogger</span><span class="o">.</span><span class="n">addHandler</span><span class="p">(</span><span class="n">handler</span><span class="p">)</span>
<span class="c1">############################################</span>
<span class="n">LoggerDumpLogHandlerAdd</span><span class="p">(</span><span class="n">inLogger</span><span class="o">=</span><span class="n">mRobotLogger</span><span class="p">,</span> <span class="n">inGSettingsClientDict</span><span class="o">=</span><span class="n">lResult</span><span class="p">[</span><span class="s2">&quot;Client&quot;</span><span class="p">])</span>
<span class="c1">#mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=lResult[&quot;Client&quot;],</span>
<span class="c1"># inKeyStr=&quot;DumpLogList&quot;,</span>
<span class="c1"># inHashKeyStr=&quot;DumpLogListHashStr&quot;,</span>
<span class="c1"># inRowCountInt=lResult[&quot;Client&quot;][</span>
<span class="c1"># &quot;DumpLogListCountInt&quot;])</span>
<span class="c1">#mHandlerDumpLogList.setFormatter(mRobotLoggerFormatter)</span>
<span class="c1">#mRobotLogger.addHandler(mHandlerDumpLogList)</span>
<span class="k">return</span> <span class="n">lResult</span> <span class="c1"># return the result dict</span>
</pre></div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="Orchestrator.html" class="btn btn-neutral float-left" title="Description" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; Copyright 2020, 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>