def screen_changed(query): global LAST_SCREEN if LAST_SCREEN is None: return {'status': 'ok', 'changed': True} screen, width, height = screen_grab.grab() return {'status': 'ok', 'changed': LAST_SCREEN != screen}
def get_screen(query): global LAST_SCREEN try: screen, width, height = screen_grab.grab() LAST_SCREEN = "" + screen return {"status": "ok", "bits": base64.b64encode(LAST_SCREEN), "width": width, "height": height} except AccessDenied: return {"status": "fail", "message": "Access Denied"} except Exception, ex: return {"status": "fail", "message": str(ex)}
def get_screen(query): global LAST_SCREEN try: screen, width, height = screen_grab.grab() LAST_SCREEN = "" + screen return { "status": "ok", "bits": base64.b64encode(LAST_SCREEN), "width": width, "height": height } except AccessDenied: return {"status": "fail", "message": "Access Denied"} except Exception, ex: return {"status": "fail", "message": str(ex)}