Beispiel #1
0
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}
Beispiel #2
0
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}
Beispiel #3
0
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)}
Beispiel #4
0
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)}