From 1be596ac10b152512d1642afb4380feca0af8912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D0=BB=D0=BE=D0=B2=20=D0=98=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=20=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B5=D0=B2=D0=B8?= =?UTF-8?q?=D1=87?= Date: Fri, 13 Dec 2019 15:43:45 +0300 Subject: [PATCH 1/4] Test1 --- Test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Test.txt diff --git a/Test.txt b/Test.txt new file mode 100644 index 00000000..e69de29b From 8e603ff62ae0604107038a3ec58915cc8ac90a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D0=BB=D0=BE=D0=B2=20=D0=98=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=20=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B5=D0=B2=D0=B8?= =?UTF-8?q?=D1=87?= Date: Mon, 20 Jan 2020 16:42:36 +0300 Subject: [PATCH 2/4] #RobotScreenSpy (tested) --- Utils/RobotScreenSpy/TechScreenSpy.py | 25 +++++++++++++++++++ Utils/RobotScreenSpy/TechScreenSpyPython.cmd | 3 +++ Utils/RobotScreenSpy/TechScreenSpyPythonw.cmd | 3 +++ v1.0.38 => v1.0.38- | 0 4 files changed, 31 insertions(+) create mode 100644 Utils/RobotScreenSpy/TechScreenSpy.py create mode 100644 Utils/RobotScreenSpy/TechScreenSpyPython.cmd create mode 100644 Utils/RobotScreenSpy/TechScreenSpyPythonw.cmd rename v1.0.38 => v1.0.38- (100%) diff --git a/Utils/RobotScreenSpy/TechScreenSpy.py b/Utils/RobotScreenSpy/TechScreenSpy.py new file mode 100644 index 00000000..d96db2d3 --- /dev/null +++ b/Utils/RobotScreenSpy/TechScreenSpy.py @@ -0,0 +1,25 @@ +import json +import os +import time +import datetime +#ControlPanelDict +from desktopmagic.screengrab_win32 import ( + getDisplayRects, saveScreenToBmp, saveRectToBmp, getScreenAsImage, + getRectAsImage, getDisplaysAsImages) +############################################ +inScreenshotFolder="Screenshots" +def SaveScreenshot(inFilePath): + # grab fullscreen + # Save the entire virtual screen as a PNG + lScreenshot = getScreenAsImage() + lScreenshot.save(inFilePath, format='png') + # lScreenshot = ScreenshotSecondScreen.grab_screen() + # save image file + # lScreenshot.save('screenshot.png') +# Сохранить файл на диск +while True: + try: + SaveScreenshot(os.path.abspath(os.path.join(inScreenshotFolder,f'Scr_{datetime.datetime.now().strftime("%Y_%m_%d__%H_%M_%S")}.png'))) + except Exception as e: + pass + time.sleep(3) \ No newline at end of file diff --git a/Utils/RobotScreenSpy/TechScreenSpyPython.cmd b/Utils/RobotScreenSpy/TechScreenSpyPython.cmd new file mode 100644 index 00000000..5d24ecb0 --- /dev/null +++ b/Utils/RobotScreenSpy/TechScreenSpyPython.cmd @@ -0,0 +1,3 @@ +cd %~dp0 +python-3.7.2.amd64\python.exe "TechScreenSpy.py" +pause >nul \ No newline at end of file diff --git a/Utils/RobotScreenSpy/TechScreenSpyPythonw.cmd b/Utils/RobotScreenSpy/TechScreenSpyPythonw.cmd new file mode 100644 index 00000000..c2dadb91 --- /dev/null +++ b/Utils/RobotScreenSpy/TechScreenSpyPythonw.cmd @@ -0,0 +1,3 @@ +cd %~dp0 +python-3.7.2.amd64\pythonw.exe "TechScreenSpy.py" +pause >nul \ No newline at end of file diff --git a/v1.0.38 b/v1.0.38- similarity index 100% rename from v1.0.38 rename to v1.0.38- From adeff32b6dc9d45248737df2723919dd03651174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D0=BB=D0=BE=D0=B2=20=D0=98=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=20=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B5=D0=B2=D0=B8?= =?UTF-8?q?=D1=87?= Date: Fri, 24 Jan 2020 14:16:42 +0300 Subject: [PATCH 3/4] Fix in SettingsUpdate --- Utils/RobotDB/SettingsExample.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Utils/RobotDB/SettingsExample.py b/Utils/RobotDB/SettingsExample.py index 3a97df1b..bdb56d6c 100644 --- a/Utils/RobotDB/SettingsExample.py +++ b/Utils/RobotDB/SettingsExample.py @@ -2,7 +2,7 @@ import psutil import datetime import logging import os - +import pdb #RobotDB settings def Settings(): import os @@ -89,8 +89,9 @@ def Settings(): import pdb #lFunction to call in subfiles lSubmoduleFunctionName = "SettingsUpdate" + #pdb.set_trace() #lSettingsPath = os.path.join(inSettingsFolderPath, "Settings") - lSettingsPath = "\\".join(__file__.split("\\")[:-1]) + lSettingsPath = "\\".join(os.path.join(os.getcwd(),__file__).split("\\")[:-1]) #lSettingsPath = os.path.join(os.getcwd(), "Settings") #Lambda function to get files .py from settings folder except Settings.py lFileList = [f for f in os.listdir(lSettingsPath) if os.path.isfile(os.path.join(lSettingsPath, f)) and f.split(".")[-1] == "py" and os.path.join(lSettingsPath, f) != __file__] From b3033fa31a559d2e8c3850115178c59e4100dd17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D0=BB=D0=BE=D0=B2=20=D0=98=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=20=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B5=D0=B2=D0=B8?= =?UTF-8?q?=D1=87?= Date: Fri, 24 Jan 2020 16:26:05 +0300 Subject: [PATCH 4/4] #TestSendRequest --- Utils/TestSendRequest/Main.py | 24 ++++++++++++++++++++++++ Utils/TestSendRequest/SendRequest.cmd | 3 +++ Utils/TestSendRequest/Settings.py | 11 +++++++++++ 3 files changed, 38 insertions(+) create mode 100644 Utils/TestSendRequest/Main.py create mode 100644 Utils/TestSendRequest/SendRequest.cmd create mode 100644 Utils/TestSendRequest/Settings.py diff --git a/Utils/TestSendRequest/Main.py b/Utils/TestSendRequest/Main.py new file mode 100644 index 00000000..7e9bc808 --- /dev/null +++ b/Utils/TestSendRequest/Main.py @@ -0,0 +1,24 @@ +#########Get settings############ +gSettings= None #Init variable +import Settings #Tool settings +gSettings = Settings.SettingsGet() +################################## +import requests #Lib for HTTP requests + +#Create HTTP session +lSession = requests.Session() +lResponse = None +#If GET +if gSettings["Method"].upper()=="GET": + lResponse = lSession.get(gSettings["URL"], headers=gSettings["Headers"], cookies=gSettings["Cookies"], verify=False, json = gSettings["JSON"]) +#If POST +elif gSettings["Method"].upper()=="POST": + lResponse = lSession.post(gSettings["URL"], headers=gSettings["Headers"], cookies=gSettings["Cookies"], verify=False, json = gSettings["JSON"]) + +print(f'SessionObject: {lResponse}, Body: {lResponse.text}') + +#Debug section +while True: + lCommand = input("Write Python cmd:") #Wait for python command + exec(lCommand) #Execute the command + \ No newline at end of file diff --git a/Utils/TestSendRequest/SendRequest.cmd b/Utils/TestSendRequest/SendRequest.cmd new file mode 100644 index 00000000..4da21971 --- /dev/null +++ b/Utils/TestSendRequest/SendRequest.cmd @@ -0,0 +1,3 @@ +cd %~dp0 +..\..\Resources\OpenRPA\v1.0.38\python-3.7.2.amd64\python.exe "Main.py" +pause >nul \ No newline at end of file diff --git a/Utils/TestSendRequest/Settings.py b/Utils/TestSendRequest/Settings.py new file mode 100644 index 00000000..4e6b8db5 --- /dev/null +++ b/Utils/TestSendRequest/Settings.py @@ -0,0 +1,11 @@ +import json +def SettingsGet(): + #Init config + lResult = { + "URL":"http://localhost:8081/SQLInsert", #Server host, example "http://localhost" Without / in the end + "Method":"POST", #Method to send HTTP (GET, POST...) + "Headers":{}, #Dictionary + "Cookies":{}, #Dictionary + "JSON":[{"TableName":"Test", "RowDict":{"Name":"Name1","Description":"DescTest", "Money":100, "Date":"01.01.2020"}}] #JSON data + } + return lResult \ No newline at end of file