예제 #1
0
def use(scr=None, remote=False, fromWith=False):
    global SCREEN
    if remote or fromWith:
        theGlobals = inspect.currentframe().f_back.f_back.f_globals
    else:
        theGlobals = inspect.currentframe().f_back.f_globals
    global remoteScreen
    if remoteScreen:
        remoteScreen.close()
        remoteScreen = None
    if not scr:
        newScreen = JScreen()
    else:
        newScreen = scr
    if (newScreen.isValid()):
        SCREEN = newScreen
        Debug.log(3,
                  "Jython: use as default region: " + SCREEN.toStringShort())
        globals()['SIKULISAVED'] = _exposeAllMethods(
            SCREEN,
            globals().get('SIKULISAVED'), theGlobals, None)
        #Debug.log(3, "Jython: after _exposeAllMethods");
        theGlobals['SCREEN'] = SCREEN
        if remote:
            remoteScreen = SCREEN
    return SCREEN
예제 #2
0
파일: Screen.py 프로젝트: Gitookps/sikuli-1
 def __init__(self, id=None):
     if id != None:
         r = JScreen.getBounds(id)
     else:
         r = JScreen().getBounds()
     (x, y, w, h) = (int(r.getX()), int(r.getY()), \
                     int(r.getWidth()), int(r.getHeight()))
     Region.__init__(self, x, y, w, h)
예제 #3
0
def use(scr=None, remote=False):
    global SCREEN
    if remote:
        theGlobals = inspect.currentframe().f_back.f_back.f_globals
    else:
        theGlobals = inspect.currentframe().f_back.f_globals
    global remoteScreen
    if remoteScreen:
        remoteScreen.close()
        remoteScreen = None
    if not scr:
        SCREEN = JScreen()
    else:
        SCREEN = scr
    Debug.log(
        3, "Jython: requested to use as default region: " +
        SCREEN.toStringShort())
    globals()['SIKULISAVED'] = _exposeAllMethods(SCREEN,
                                                 globals().get('SIKULISAVED'),
                                                 theGlobals, None)
    theGlobals['SCREEN'] = SCREEN
    if remote:
        remoteScreen = SCREEN
    return SCREEN