|
|
@ -6,7 +6,14 @@ import subprocess
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
import zlib
|
|
|
|
import zlib
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
|
|
|
|
import PIL
|
|
|
|
|
|
|
|
from PIL import ImageGrab
|
|
|
|
from threading import Thread
|
|
|
|
from threading import Thread
|
|
|
|
|
|
|
|
def SaveScreenshot(inFilePath):
|
|
|
|
|
|
|
|
# grab fullscreen
|
|
|
|
|
|
|
|
lScreenshot = ImageGrab.grab()
|
|
|
|
|
|
|
|
# save image file
|
|
|
|
|
|
|
|
lScreenshot.save('screenshot.png')
|
|
|
|
|
|
|
|
|
|
|
|
class RobotDaemonServer(Thread):
|
|
|
|
class RobotDaemonServer(Thread):
|
|
|
|
def __init__(self,name):
|
|
|
|
def __init__(self,name):
|
|
|
@ -59,6 +66,12 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
|
|
|
|
#Мост между файлом и http запросом (новый формат)
|
|
|
|
#Мост между файлом и http запросом (новый формат)
|
|
|
|
if self.path == '/favicon.ico':
|
|
|
|
if self.path == '/favicon.ico':
|
|
|
|
self.SendResponseContentTypeFile('image/x-icon',"..\\..\\favicon.ico")
|
|
|
|
self.SendResponseContentTypeFile('image/x-icon',"..\\..\\favicon.ico")
|
|
|
|
|
|
|
|
#Получить скриншот
|
|
|
|
|
|
|
|
if self.path == '/GetScreenshot':
|
|
|
|
|
|
|
|
#Сохранить файл на диск
|
|
|
|
|
|
|
|
SaveScreenshot("Screenshot.png")
|
|
|
|
|
|
|
|
self.SendResponseContentTypeFile('image/png',"Screenshot.png")
|
|
|
|
|
|
|
|
|
|
|
|
#Action ObjectInspector GetObjectList
|
|
|
|
#Action ObjectInspector GetObjectList
|
|
|
|
if self.path == '/ObjectDetector/JSONGetWindowList':
|
|
|
|
if self.path == '/ObjectDetector/JSONGetWindowList':
|
|
|
|
#ReadRequest
|
|
|
|
#ReadRequest
|
|
|
|