Commit 9f411c5b authored by Ivan Maslov's avatar Ivan Maslov

Merge branch 'Recycle' of https://gitlab.com/UnicodeLabs/OpenRPA.git

parents c923087a b3033fa3
......@@ -2,7 +2,7 @@ import psutil
import datetime
import logging
import os
import pdb
#RobotDB settings
def Settings():
import os
......@@ -89,6 +89,7 @@ def Settings():
import pdb
#lFunction to call in subfiles
lSubmoduleFunctionName = "SettingsUpdate"
#pdb.set_trace()
#lSettingsPath = os.path.join(inSettingsFolderPath, "Settings")
lSettingsPath = "\\".join(os.path.join(os.getcwd(),__file__).split("\\")[:-1])
#lSettingsPath = os.path.join(os.getcwd(), "Settings")
......
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
cd %~dp0
python-3.7.2.amd64\python.exe "TechScreenSpy.py"
pause >nul
\ No newline at end of file
cd %~dp0
python-3.7.2.amd64\pythonw.exe "TechScreenSpy.py"
pause >nul
\ No newline at end of file
#########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
cd %~dp0
..\..\Resources\OpenRPA\v1.0.38\python-3.7.2.amd64\python.exe "Main.py"
pause >nul
\ No newline at end of file
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment