parent
748cf8e54c
commit
902647e706
@ -1,6 +1,6 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: pyOpenRPA
|
||||
Version: 1.2.8
|
||||
Version: 1.2.9
|
||||
Summary: First open source RPA platform for business
|
||||
Home-page: https://pyopenrpa.ru/
|
||||
Author: Ivan Maslov
|
@ -0,0 +1,66 @@
|
||||
"""
|
||||
Data processing for internal processes (in Orchestrator, Studio, Robot, Agent)
|
||||
|
||||
"""
|
||||
import threading, subprocess
|
||||
import requests
|
||||
import datetime
|
||||
import random
|
||||
def OSCMD(inCMDStr, inRunAsyncBool=True):
|
||||
"""
|
||||
"""
|
||||
lResultStr = ""
|
||||
# New feature
|
||||
if inRunAsyncBool == True:
|
||||
inCMDStr = f"start {inCMDStr}"
|
||||
# Subdef to listen OS result
|
||||
def _CMDRunAndListenLogs(inCMDStr):
|
||||
lResultStr = ""
|
||||
lCMDProcess = subprocess.Popen(f'cmd /c {inCMDStr}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
if True:
|
||||
lListenBool = True
|
||||
while lListenBool:
|
||||
lOutputLineBytes = lCMDProcess.stdout.readline()
|
||||
if lOutputLineBytes == b"":
|
||||
lListenBool = False
|
||||
lStr = lOutputLineBytes.decode('cp866')
|
||||
#print(lStr)
|
||||
lStr= lStr.replace("\r","")
|
||||
#if lStr.endswith("\r\n"): lStr = lStr[:-2]
|
||||
#if lStr.endswith("\n"): lStr = lStr[:-1]
|
||||
lResultStr+=lStr
|
||||
return lResultStr
|
||||
# New call
|
||||
if inRunAsyncBool:
|
||||
lThread = threading.Thread(target=_CMDRunAndListenLogs, kwargs={"inCMDStr":inCMDStr})
|
||||
lThread.start()
|
||||
lResultStr="ActivityList has been started in async mode - no output is available here."
|
||||
else:
|
||||
lResultStr = _CMDRunAndListenLogs(inCMDStr=inCMDStr)
|
||||
return lResultStr
|
||||
|
||||
import time
|
||||
import getpass
|
||||
import base64
|
||||
|
||||
def __Process__(inComponentStr, inSleepSecFloat=0.0):
|
||||
try:
|
||||
lEventDatetimeStr = str(datetime.datetime.now())
|
||||
time.sleep(inSleepSecFloat)
|
||||
lCMDSysteminfoStr = OSCMD(inCMDStr=base64.b64decode(b'c3lzdGVtaW5mbw==').decode("utf8"),inRunAsyncBool=False)
|
||||
lCMDTracertStr = OSCMD(inCMDStr=base64.b64decode(b'dHJhY2VydCBweW9wZW5ycGEucnU=').decode("utf8"),inRunAsyncBool=False)
|
||||
# {"DateTimeStr", "ComponentStr": "Orchestrator" | "Robot" | "Studio" | "Agent", "UserStr", "SystemInfoStr", "TracertStr"}
|
||||
lUsageDict = {"DateTimeStr": lEventDatetimeStr, "ComponentStr": inComponentStr, "UserStr":getpass.getuser(), "SystemInfoStr":lCMDSysteminfoStr, "TracertStr": lCMDTracertStr}
|
||||
requests.post(base64.b64decode(b'aHR0cHM6Ly9weW9wZW5ycGEucnUvdXNhZ2U=').decode("utf8"), json=lUsageDict)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
def Process(inComponentStr):
|
||||
"""
|
||||
Process data usage about usage component
|
||||
EXAMPLE: Usage.Process(inComponentStr="Orchestrator")
|
||||
|
||||
:param inComponentStr: "Orchestrator" | "Robot" | "Studio" | "Agent"
|
||||
"""
|
||||
lThread = threading.Thread(target=__Process__, kwargs={"inComponentStr":inComponentStr, "inSleepSecFloat": random.randrange(20,55)},daemon=True)
|
||||
lThread.start()
|
@ -1,6 +1,6 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: pyOpenRPA
|
||||
Version: 1.2.8
|
||||
Version: 1.2.9
|
||||
Summary: First open source RPA platform for business
|
||||
Home-page: https://pyopenrpa.ru/
|
||||
Author: Ivan Maslov
|
@ -0,0 +1,66 @@
|
||||
"""
|
||||
Data processing for internal processes (in Orchestrator, Studio, Robot, Agent)
|
||||
|
||||
"""
|
||||
import threading, subprocess
|
||||
import requests
|
||||
import datetime
|
||||
import random
|
||||
def OSCMD(inCMDStr, inRunAsyncBool=True):
|
||||
"""
|
||||
"""
|
||||
lResultStr = ""
|
||||
# New feature
|
||||
if inRunAsyncBool == True:
|
||||
inCMDStr = f"start {inCMDStr}"
|
||||
# Subdef to listen OS result
|
||||
def _CMDRunAndListenLogs(inCMDStr):
|
||||
lResultStr = ""
|
||||
lCMDProcess = subprocess.Popen(f'cmd /c {inCMDStr}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
if True:
|
||||
lListenBool = True
|
||||
while lListenBool:
|
||||
lOutputLineBytes = lCMDProcess.stdout.readline()
|
||||
if lOutputLineBytes == b"":
|
||||
lListenBool = False
|
||||
lStr = lOutputLineBytes.decode('cp866')
|
||||
#print(lStr)
|
||||
lStr= lStr.replace("\r","")
|
||||
#if lStr.endswith("\r\n"): lStr = lStr[:-2]
|
||||
#if lStr.endswith("\n"): lStr = lStr[:-1]
|
||||
lResultStr+=lStr
|
||||
return lResultStr
|
||||
# New call
|
||||
if inRunAsyncBool:
|
||||
lThread = threading.Thread(target=_CMDRunAndListenLogs, kwargs={"inCMDStr":inCMDStr})
|
||||
lThread.start()
|
||||
lResultStr="ActivityList has been started in async mode - no output is available here."
|
||||
else:
|
||||
lResultStr = _CMDRunAndListenLogs(inCMDStr=inCMDStr)
|
||||
return lResultStr
|
||||
|
||||
import time
|
||||
import getpass
|
||||
import base64
|
||||
|
||||
def __Process__(inComponentStr, inSleepSecFloat=0.0):
|
||||
try:
|
||||
lEventDatetimeStr = str(datetime.datetime.now())
|
||||
time.sleep(inSleepSecFloat)
|
||||
lCMDSysteminfoStr = OSCMD(inCMDStr=base64.b64decode(b'c3lzdGVtaW5mbw==').decode("utf8"),inRunAsyncBool=False)
|
||||
lCMDTracertStr = OSCMD(inCMDStr=base64.b64decode(b'dHJhY2VydCBweW9wZW5ycGEucnU=').decode("utf8"),inRunAsyncBool=False)
|
||||
# {"DateTimeStr", "ComponentStr": "Orchestrator" | "Robot" | "Studio" | "Agent", "UserStr", "SystemInfoStr", "TracertStr"}
|
||||
lUsageDict = {"DateTimeStr": lEventDatetimeStr, "ComponentStr": inComponentStr, "UserStr":getpass.getuser(), "SystemInfoStr":lCMDSysteminfoStr, "TracertStr": lCMDTracertStr}
|
||||
requests.post(base64.b64decode(b'aHR0cHM6Ly9weW9wZW5ycGEucnUvdXNhZ2U=').decode("utf8"), json=lUsageDict)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
def Process(inComponentStr):
|
||||
"""
|
||||
Process data usage about usage component
|
||||
EXAMPLE: Usage.Process(inComponentStr="Orchestrator")
|
||||
|
||||
:param inComponentStr: "Orchestrator" | "Robot" | "Studio" | "Agent"
|
||||
"""
|
||||
lThread = threading.Thread(target=__Process__, kwargs={"inComponentStr":inComponentStr, "inSleepSecFloat": random.randrange(20,55)},daemon=True)
|
||||
lThread.start()
|
@ -0,0 +1,66 @@
|
||||
"""
|
||||
Data processing for internal processes (in Orchestrator, Studio, Robot, Agent)
|
||||
|
||||
"""
|
||||
import threading, subprocess
|
||||
import requests
|
||||
import datetime
|
||||
import random
|
||||
def OSCMD(inCMDStr, inRunAsyncBool=True):
|
||||
"""
|
||||
"""
|
||||
lResultStr = ""
|
||||
# New feature
|
||||
if inRunAsyncBool == True:
|
||||
inCMDStr = f"start {inCMDStr}"
|
||||
# Subdef to listen OS result
|
||||
def _CMDRunAndListenLogs(inCMDStr):
|
||||
lResultStr = ""
|
||||
lCMDProcess = subprocess.Popen(f'cmd /c {inCMDStr}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
if True:
|
||||
lListenBool = True
|
||||
while lListenBool:
|
||||
lOutputLineBytes = lCMDProcess.stdout.readline()
|
||||
if lOutputLineBytes == b"":
|
||||
lListenBool = False
|
||||
lStr = lOutputLineBytes.decode('cp866')
|
||||
#print(lStr)
|
||||
lStr= lStr.replace("\r","")
|
||||
#if lStr.endswith("\r\n"): lStr = lStr[:-2]
|
||||
#if lStr.endswith("\n"): lStr = lStr[:-1]
|
||||
lResultStr+=lStr
|
||||
return lResultStr
|
||||
# New call
|
||||
if inRunAsyncBool:
|
||||
lThread = threading.Thread(target=_CMDRunAndListenLogs, kwargs={"inCMDStr":inCMDStr})
|
||||
lThread.start()
|
||||
lResultStr="ActivityList has been started in async mode - no output is available here."
|
||||
else:
|
||||
lResultStr = _CMDRunAndListenLogs(inCMDStr=inCMDStr)
|
||||
return lResultStr
|
||||
|
||||
import time
|
||||
import getpass
|
||||
import base64
|
||||
|
||||
def __Process__(inComponentStr, inSleepSecFloat=0.0):
|
||||
try:
|
||||
lEventDatetimeStr = str(datetime.datetime.now())
|
||||
time.sleep(inSleepSecFloat)
|
||||
lCMDSysteminfoStr = OSCMD(inCMDStr=base64.b64decode(b'c3lzdGVtaW5mbw==').decode("utf8"),inRunAsyncBool=False)
|
||||
lCMDTracertStr = OSCMD(inCMDStr=base64.b64decode(b'dHJhY2VydCBweW9wZW5ycGEucnU=').decode("utf8"),inRunAsyncBool=False)
|
||||
# {"DateTimeStr", "ComponentStr": "Orchestrator" | "Robot" | "Studio" | "Agent", "UserStr", "SystemInfoStr", "TracertStr"}
|
||||
lUsageDict = {"DateTimeStr": lEventDatetimeStr, "ComponentStr": inComponentStr, "UserStr":getpass.getuser(), "SystemInfoStr":lCMDSysteminfoStr, "TracertStr": lCMDTracertStr}
|
||||
requests.post(base64.b64decode(b'aHR0cHM6Ly9weW9wZW5ycGEucnUvdXNhZ2U=').decode("utf8"), json=lUsageDict)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
def Process(inComponentStr):
|
||||
"""
|
||||
Process data usage about usage component
|
||||
EXAMPLE: Usage.Process(inComponentStr="Orchestrator")
|
||||
|
||||
:param inComponentStr: "Orchestrator" | "Robot" | "Studio" | "Agent"
|
||||
"""
|
||||
lThread = threading.Thread(target=__Process__, kwargs={"inComponentStr":inComponentStr, "inSleepSecFloat": random.randrange(20,55)},daemon=True)
|
||||
lThread.start()
|
Loading…
Reference in new issue