From d5f165f88226c0750cbaff3c68da1fb2194ec5b3 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Sun, 28 Aug 2022 16:34:10 +0300 Subject: [PATCH] Rename start file in orchestrator, fix in ServerSettings for Linux --- ...{pyOpenRPA.Orchestrator_x64.cmd => start.cmd} | 0 .../{pyOpenRPA.Orchestrator_x64.sh => start.sh} | 0 Sources/pyOpenRPA/Orchestrator/ServerSettings.py | 16 +++++++++++----- Sources/pyOpenRPA/Robot/UIWeb.py | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) rename Orchestrator/{pyOpenRPA.Orchestrator_x64.cmd => start.cmd} (100%) rename Orchestrator/{pyOpenRPA.Orchestrator_x64.sh => start.sh} (100%) diff --git a/Orchestrator/pyOpenRPA.Orchestrator_x64.cmd b/Orchestrator/start.cmd similarity index 100% rename from Orchestrator/pyOpenRPA.Orchestrator_x64.cmd rename to Orchestrator/start.cmd diff --git a/Orchestrator/pyOpenRPA.Orchestrator_x64.sh b/Orchestrator/start.sh similarity index 100% rename from Orchestrator/pyOpenRPA.Orchestrator_x64.sh rename to Orchestrator/start.sh diff --git a/Sources/pyOpenRPA/Orchestrator/ServerSettings.py b/Sources/pyOpenRPA/Orchestrator/ServerSettings.py index 1f0f928a..4506adb8 100644 --- a/Sources/pyOpenRPA/Orchestrator/ServerSettings.py +++ b/Sources/pyOpenRPA/Orchestrator/ServerSettings.py @@ -8,7 +8,7 @@ if CrossOS.IS_WINDOWS_BOOL: #CrossOS getDisplayRects, saveScreenToBmp, saveRectToBmp, getScreenAsImage, getRectAsImage, getDisplaysAsImages) -if CrossOS.IS_LINUX_BOOL: pass +if CrossOS.IS_LINUX_BOOL: import pyscreeze from http import cookies import uuid # generate UUID4 @@ -197,9 +197,9 @@ def pyOpenRPA_Screenshot(inRequest,inGlobalDict): # Get Screenshot def SaveScreenshot(inFilePath): # grab fullscreen - # Save the entire virtual screen as a PNG + # Save the entire virtual screen as a PNsG lScreenshot = getScreenAsImage() - lScreenshot.save('screenshot.png', format='png') + lScreenshot.save('Screenshot.png', format='png') # lScreenshot = ScreenshotSecondScreen.grab_screen() # save image file # lScreenshot.save('screenshot.png') @@ -211,7 +211,13 @@ def pyOpenRPA_Screenshot(inRequest,inGlobalDict): inRequest.OpenRPAResponseDict["Body"] = lFileObject.read() # Закрыть файловый объект lFileObject.close() - else: lFileObject = b'' + else: + pyscreeze._screenshot_linux(imageFilename='Screenshot.png') + lFileObject = open("Screenshot.png", "rb") + # Write content as utf-8 data + inRequest.OpenRPAResponseDict["Body"] = lFileObject.read() + # Закрыть файловый объект + lFileObject.close() # Add activity item or activity list to the processor queue # Body is Activity item or Activity List @@ -494,4 +500,4 @@ def SettingsUpdate(inGlobalConfiguration): ] Usage.Process(inComponentStr="Orchestrator") inGlobalConfiguration["ServerDict"]["URLList"]=inGlobalConfiguration["ServerDict"]["URLList"]+lURLList - return inGlobalConfiguration \ No newline at end of file + return inGlobalConfiguration diff --git a/Sources/pyOpenRPA/Robot/UIWeb.py b/Sources/pyOpenRPA/Robot/UIWeb.py index 93290849..da73a4bd 100644 --- a/Sources/pyOpenRPA/Robot/UIWeb.py +++ b/Sources/pyOpenRPA/Robot/UIWeb.py @@ -23,7 +23,7 @@ def BrowserChromeStart(inDriverExePathStr:str = None, inChromeExePathStr:str = N from pyOpenRPA.Robot import UIWeb UIWeb.BrowserChromeStart() UIWeb.BrowserClose() - + :param inDriverExePathStr: Путь до компонента webdriver.exe, по умолчанию None (путь до webdriver.exe, который расположен в репозитории pyOpenRPA) :type inDriverExePathStr: str, опционально :param inChromeExePathStr:Путь до компонента chrome.exe, по умолчанию None (путь до chrome.exe, который расположен в репозитории pyOpenRPA)