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.
584 lines
46 KiB
584 lines
46 KiB
4 years ago
|
|
||
|
|
||
|
<!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 — 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> »</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">"VersionStr"</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">"Autocleaner"</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">"IntervalSecFloat"</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">"Client"</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Settings about client web orchestrator</span>
|
||
|
<span class="s2">"Session"</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">"LifetimeSecFloat"</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">"LifetimeRequestSecFloat"</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">"ControlPanelRefreshIntervalSecFloat"</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">"TechnicalSessionGUIDCache"</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># TEchnical cache. Fills when web browser is requesting</span>
|
||
|
<span class="c1"># "SessionGUIDStr":{ # Session with some GUID str. On client session guid stored in cookie "SessionGUIDStr"</span>
|
||
|
<span class="c1"># "InitDatetime": None, # Datetime when session GUID was created</span>
|
||
|
<span class="c1"># "DatasetLast": {</span>
|
||
|
<span class="c1"># "ControlPanel": {</span>
|
||
|
<span class="c1"># "Data": None, # Struct to check with new iterations. None if starts</span>
|
||
|
<span class="c1"># "ReturnBool": False # flag to return, close request and return data as json</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># "ClientRequestHandler": None, # Last client request handler</span>
|
||
|
<span class="c1"># "UserADStr": None, # User, who connect. None if user is not exists</span>
|
||
|
<span class="c1"># "DomainADStr": 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">"DumpLogListRefreshIntervalSecFloat"</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">"DumpLogListCountInt"</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">"DumpLogList"</span><span class="p">:</span> <span class="p">[],</span> <span class="c1"># Will be filled automatically</span>
|
||
|
<span class="s2">"DumpLogListHashStr"</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">"ServerDict"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="s2">"WorkingDirectoryPathStr"</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">"RequestTimeoutSecFloat"</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">"ListenPort_"</span><span class="p">:</span> <span class="s2">"Порт, по которому можно подключиться к демону"</span><span class="p">,</span>
|
||
|
<span class="s2">"ListenPort"</span><span class="p">:</span> <span class="mi">80</span><span class="p">,</span>
|
||
|
<span class="s2">"ListenURLList"</span><span class="p">:</span> <span class="p">[</span>
|
||
|
<span class="p">{</span>
|
||
|
<span class="s2">"Description"</span><span class="p">:</span> <span class="s2">"Local machine test"</span><span class="p">,</span>
|
||
|
<span class="s2">"URL_"</span><span class="p">:</span> <span class="s2">"Сетевое расположение сервера демона"</span><span class="p">,</span>
|
||
|
<span class="s2">"URL"</span><span class="p">:</span> <span class="s2">""</span>
|
||
|
<span class="p">}</span>
|
||
|
<span class="p">],</span>
|
||
|
<span class="s2">"AccessUsers"</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Default - all URL is blocked</span>
|
||
|
<span class="s2">"FlagCredentialsAsk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Turn on Authentication</span>
|
||
|
<span class="s2">"RuleDomainUserDict"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="c1"># ("DOMAIN", "USER"): { !!!!! only in upper case !!!!</span>
|
||
|
<span class="c1"># "MethodMatchURLBeforeList": [</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Method":"GET|POST",</span>
|
||
|
<span class="c1"># "MatchType":"BeginWith|Contains|Equal|EqualCase",</span>
|
||
|
<span class="c1"># "URL":"",</span>
|
||
|
<span class="c1"># "FlagAccessDefRequestGlobalAuthenticate": None, #Return bool</span>
|
||
|
<span class="c1"># "FlagAccess": True</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="c1"># ],</span>
|
||
|
<span class="c1"># "ControlPanelKeyAllowedList":[], # If empty - all is allowed</span>
|
||
|
<span class="c1"># "RoleHierarchyAllowedDict": {</span>
|
||
|
<span class="c1"># "Orchestrator":{</span>
|
||
|
<span class="c1"># "Controls": {</span>
|
||
|
<span class="c1"># "RestartOrchestrator": {}, # Feature to restart orchestrator on virtual machine</span>
|
||
|
<span class="c1"># "LookMachineScreenshots": {} # Feature to look machina screenshots</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># "RDPActive": { # Robot RDP active module</span>
|
||
|
<span class="c1"># "ListRead": {} # 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">"RuleMethodMatchURLBeforeList"</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"># "Method":"GET|POST",</span>
|
||
|
<span class="c1"># "MatchType":"BeginWith|Contains|Equal|EqualCase",</span>
|
||
|
<span class="c1"># "URL":"",</span>
|
||
|
<span class="c1"># "FlagAccessDefRequestGlobalAuthenticate": None, #Return bool</span>
|
||
|
<span class="c1"># "FlagAccess": True</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="p">],</span>
|
||
|
<span class="s2">"AuthTokensDict"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="c1"># "<AuthToken>":{"User":"", "Domain":"", "TokenDatetime":<Datetime>, "FlagDoNotExpire":True}</span>
|
||
|
<span class="p">}</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"URLList"</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"># "Method":"GET|POST",</span>
|
||
|
<span class="c1"># "URL": "/index", #URL of the request</span>
|
||
|
<span class="c1"># "MatchType": "", #"BeginWith|Contains|Equal|EqualCase",</span>
|
||
|
<span class="c1"># "ResponseFilePath": "", #Absolute or relative path</span>
|
||
|
<span class="c1"># "ResponseFolderPath": "", #Absolute or relative path</span>
|
||
|
<span class="c1"># "ResponseContentType": "", #HTTP Content-type</span>
|
||
|
<span class="c1"># "ResponseDefRequestGlobal": None #Function with str result</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="p">{</span>
|
||
|
<span class="s2">"Method"</span><span class="p">:</span> <span class="s2">"GET"</span><span class="p">,</span>
|
||
|
<span class="s2">"URL"</span><span class="p">:</span> <span class="s2">"/test/"</span><span class="p">,</span> <span class="c1"># URL of the request</span>
|
||
|
<span class="s2">"MatchType"</span><span class="p">:</span> <span class="s2">"BeginWith"</span><span class="p">,</span> <span class="c1"># "BeginWith|Contains|Equal|EqualCase",</span>
|
||
|
<span class="c1"># "ResponseFilePath": "", #Absolute or relative path</span>
|
||
|
<span class="s2">"ResponseFolderPath"</span><span class="p">:</span> <span class="s2">"C:\Abs\Archive\scopeSrcUL\OpenRPA\Orchestrator\Settings"</span><span class="p">,</span>
|
||
|
<span class="c1"># Absolute or relative path</span>
|
||
|
<span class="c1"># "ResponseContentType": "", #HTTP Content-type</span>
|
||
|
<span class="c1"># "ResponseDefRequestGlobal": None #Function with str result</span>
|
||
|
<span class="p">}</span>
|
||
|
<span class="p">],</span>
|
||
|
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"OrchestratorStart"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="s2">"DefSettingsUpdatePathList"</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">"ActivityList"</span><span class="p">:</span> <span class="p">[</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "ProcessStop", #Activity type</span>
|
||
|
<span class="c1"># "Name": "OpenRPARobotDaemon.exe", #Process name</span>
|
||
|
<span class="c1"># "FlagForce": True, #Force process close</span>
|
||
|
<span class="c1"># "User": "%username%" #Empty, user or %username%</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "ProcessStartIfTurnedOff", #Activity type</span>
|
||
|
<span class="c1"># "CheckTaskName": "notepad.exe", #Python function module name</span>
|
||
|
<span class="c1"># "Path": "notepad", #Python function name</span>
|
||
|
<span class="c1"># "ArgList": [] #Input python function args</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "RDPSessionConnect", #Activity type - start/connect RDP Session</span>
|
||
|
<span class="c1"># "RDPSessionKeyStr": "notepad.exe", #Python function module name</span>
|
||
|
<span class="c1"># "RDPConfigurationDict": {}</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "RDPSessionLogoff", #Activity type - logoff RDP Session</span>
|
||
|
<span class="c1"># "RDPSessionKeyStr": "notepad.exe", #Python function module name</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "RDPSessionDisconnect", #Activity type - disconnect the RDP Session without logoff</span>
|
||
|
<span class="c1"># "RDPSessionKeyStr": "notepad.exe", #Python function module name</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "RDPSessionFileSend", #Activity type - send file to RDP session</span>
|
||
|
<span class="c1"># ...</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "RDPSessionFileRecieve", #Activity type - recieve file from rdp session</span>
|
||
|
<span class="c1"># ...</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "RDPSessionProcessStart", #Activity type -</span>
|
||
|
<span class="c1"># ...</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="p">]</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"SchedulerDict"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="s2">"CheckIntervalSecFloat"</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">"ActivityTimeList"</span><span class="p">:</span> <span class="p">[</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "TimeHH:MMStr": "22:23", # Time [HH:MM] to trigger activity</span>
|
||
|
<span class="c1"># "WeekdayList": [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"># "ActivityList": [</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Type": "ProcessStart", # Activity type</span>
|
||
|
<span class="c1"># "Path": "start", # Executable file path</span>
|
||
|
<span class="c1"># "ArgList": ["cmd.exe", "/c", "PIPUpgrade.cmd"] # List of the arguments</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="c1"># ],</span>
|
||
|
<span class="c1"># "GUID": 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">"ProcessorDict"</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">"ActivityList"</span><span class="p">:</span> <span class="p">[</span> <span class="c1"># List of the activities</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "Def":"DefAliasTest", # def link or def alias (look gSettings["Processor"]["AliasDefDict"])</span>
|
||
|
<span class="c1"># "ArgList":[1,2,3], # Args list</span>
|
||
|
<span class="c1"># "ArgDict":{"ttt":1,"222":2,"dsd":3} # Args dictionary</span>
|
||
|
<span class="c1"># "ArgGSettings": # Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
|
||
|
<span class="c1"># "ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="p">],</span>
|
||
|
<span class="s2">"AliasDefDict"</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">"CheckIntervalSecFloat"</span><span class="p">:</span> <span class="mf">1.0</span><span class="p">,</span> <span class="c1"># Interval for check gSettings in ProcessorDict > ActivityList</span>
|
||
|
<span class="s2">"ExecuteBool"</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">"ThreadIdInt"</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">"ControlPanelDict"</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Old structure > CPDict</span>
|
||
|
<span class="s2">"RefreshSeconds"</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span> <span class="c1"># deprecated parameter</span>
|
||
|
<span class="s2">"RobotList"</span><span class="p">:</span> <span class="p">[</span>
|
||
|
<span class="c1">#{</span>
|
||
|
<span class="c1"># "RenderFunction": RenderRobotR01,</span>
|
||
|
<span class="c1"># "KeyStr": "TestControlPanelKey"</span>
|
||
|
<span class="c1">#}</span>
|
||
|
<span class="p">]</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"CPDict"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="c1"># "CPKey": {"HTMLRenderDef":None, "JSONGeneratorDef":None, "JSInitGeneratorDef":None}</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="c1"># # # # # # # # # # # # # #</span>
|
||
|
<span class="s2">"RobotRDPActive"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="s2">"RDPList"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="c1"># "RDPSessionKey":{</span>
|
||
|
<span class="c1"># "Host": "77.77.22.22", # Host address</span>
|
||
|
<span class="c1"># "Port": "3389", # RDP Port</span>
|
||
|
<span class="c1"># "Login": "test", # Login</span>
|
||
|
<span class="c1"># "Password": "test", # Password</span>
|
||
|
<span class="c1"># "Screen": {</span>
|
||
|
<span class="c1"># "Width": 1680, # Width of the remote desktop in pixels</span>
|
||
|
<span class="c1"># "Height": 1050, # Height of the remote desktop in pixels</span>
|
||
|
<span class="c1"># # "640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen</span>
|
||
|
<span class="c1"># "FlagUseAllMonitors": False, # True or False</span>
|
||
|
<span class="c1"># "DepthBit": "32" # "32" or "24" or "16" or "15"</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># "SharedDriveList": ["c"], # List of the Root sesion hard drives</span>
|
||
|
<span class="c1"># ###### Will updated in program ############</span>
|
||
|
<span class="c1"># "SessionHex": "", # Hex is created when robot runs</span>
|
||
|
<span class="c1"># "SessionIsWindowExistBool": False, # Flag if the RDP window is exist, old name "FlagSessionIsActive". Check every n seconds</span>
|
||
|
<span class="c1"># "SessionIsWindowResponsibleBool": 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"># "SessionIsIgnoredBool": False # Flag to ignore RDP window False - dont ignore, True - ignore</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"ResponsibilityCheckIntervalSec"</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">"FullScreenRDPSessionKeyStr"</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">"ActivityList"</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"># "DefNameStr":"test", # Function name in RobotRDPActive.Processor</span>
|
||
|
<span class="c1"># "ArgList":[1,2,3], # Args list</span>
|
||
|
<span class="c1"># "ArgDict":{"ttt":1,"222":2,"dsd":3} # Args dictionary</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "DefNameStr": "RDPSessionConnect", # Function name in RobotRDPActive.Processor</span>
|
||
|
<span class="c1"># "ArgList": [], # Args list</span>
|
||
|
<span class="c1"># "ArgDict": {"inRDPSessionKeyStr": "TestRDP", "inHostStr": "77.44.33.22", "inPortStr": "3389",</span>
|
||
|
<span class="c1"># "inLoginStr": "login", "inPasswordStr": "pass"} # Args dictionary</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "DefNameStr": "RDPSessionDisconnect", # Disconnect the RDP session without logoff. Function name in RobotRDPActive.Processor</span>
|
||
|
<span class="c1"># "ArgList": [], # Args list</span>
|
||
|
<span class="c1"># "ArgDict": {"inRDPSessionKeyStr": "TestRDP"}</span>
|
||
|
<span class="c1"># },</span>
|
||
|
<span class="c1"># {</span>
|
||
|
<span class="c1"># "DefNameStr": "RDPSessionReconnect", # Disconnect the RDP session without logoff. Function name in RobotRDPActive.Processor</span>
|
||
|
<span class="c1"># "ArgList": [], # Args list</span>
|
||
|
<span class="c1"># "ArgDict": {"inRDPSessionKeyStr": "TestRDP"}</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="p">]</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="c1"># # # # # # # # # # # # # #</span>
|
||
|
<span class="s2">"FileManager"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="s2">"FileURLFilePathDict_help"</span><span class="p">:</span> <span class="s2">"https://localhost:8081/filemanager/<file URL>. All FileURL s must be set in lowercase"</span><span class="p">,</span>
|
||
|
<span class="s2">"FileURLFilePathDict"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="c1">#"r01/report.xlsx": "C:\\RPA\\R01_IntegrationOrderOut\\Data\\Reestr_otgruzok.xlsx"</span>
|
||
|
<span class="p">}</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"Logger"</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">"Orchestrator"</span><span class="p">),</span>
|
||
|
<span class="s2">"Storage"</span><span class="p">:</span> <span class="p">{</span>
|
||
|
<span class="s2">"Robot_R01_help"</span><span class="p">:</span> <span class="s2">"Robot data storage in orchestrator env"</span><span class="p">,</span>
|
||
|
<span class="s2">"Robot_R01"</span><span class="p">:</span> <span class="p">{},</span>
|
||
|
<span class="s2">"R01_OrchestratorToRobot"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"Test2"</span><span class="p">:</span> <span class="s2">"Test2"</span><span class="p">}</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"AgentDict"</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Will be filled when program runs</span>
|
||
|
<span class="c1">#("HostNameUpperStr", "UserUpperStr"): { "IsListenBool": True, "QueueList": [] }</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">"IsListenBool"</span><span class="p">:</span><span class="kc">False</span><span class="p">,</span> <span class="s2">"ConnectionCountInt"</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s2">"ConnectionFirstQueueItemCountInt"</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s2">"ActivityList"</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">"pyOpenRPADict"</span><span class="p">:{</span>
|
||
|
<span class="s2">"CPKeyDict"</span><span class="p">:{</span> <span class="c1"># Empty dict - all access</span>
|
||
|
<span class="c1"># "CPKeyStr"{</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"RDPKeyDict"</span><span class="p">:{</span> <span class="c1"># Empty dict - all access</span>
|
||
|
<span class="c1">#"RDPKeyStr"{</span>
|
||
|
<span class="c1"># "FullscreenBool": True,</span>
|
||
|
<span class="c1"># "IgnoreBool":True,</span>
|
||
|
<span class="c1"># "ReconnectBool": True</span>
|
||
|
<span class="c1"># "NothingBool": 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">"AgentKeyDict"</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Empty dict - all access</span>
|
||
|
<span class="c1"># "AgentKeyStr"{</span>
|
||
|
<span class="c1"># }</span>
|
||
|
<span class="p">},</span>
|
||
|
<span class="s2">"AdminDict"</span><span class="p">:{</span> <span class="c1"># Empty dict - all access</span>
|
||
|
<span class="s2">"LogViewerBool"</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">"CMDInputBool"</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">"ScreenshotViewerBool"</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">"RestartOrchestratorBool"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Restart orchestrator activity</span>
|
||
|
<span class="s2">"RestartOrchestratorGITPullBool"</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">"RestartPCBool"</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">"NothingBool"</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">"ActivityDict"</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Empty dict - all access</span>
|
||
|
<span class="s2">"ActivityListExecuteBool"</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">"ActivityListAppendProcessorQueueBool"</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">'</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">'</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">"DumpLogList"</span><span class="p">,</span> <span class="n">inHashKeyStr</span><span class="o">=</span><span class="s2">"DumpLogListHashStr"</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">"DumpLogListCountInt"</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"># "BASIC" - 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">"BASIC"</span><span class="p">):</span>
|
||
|
<span class="k">if</span> <span class="n">inModeStr</span><span class="o">==</span><span class="s2">"BASIC"</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="w" 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">"Reports"</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">"Reports"</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">"Logger"</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">"Reports</span><span class="se">\\</span><span class="s2">"</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">"%Y_%m_</span><span class="si">%d</span><span class="s2">"</span><span class="p">)</span> <span class="o">+</span> <span class="s2">".log"</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">'</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">'</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">"Client"</span><span class="p">])</span>
|
||
|
<span class="c1">#mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=lResult["Client"],</span>
|
||
|
<span class="c1"># inKeyStr="DumpLogList",</span>
|
||
|
<span class="c1"># inHashKeyStr="DumpLogListHashStr",</span>
|
||
|
<span class="c1"># inRowCountInt=lResult["Client"][</span>
|
||
|
<span class="c1"># "DumpLogListCountInt"])</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>
|
||
|
© 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>
|