本文整理汇总了Python中org.sikuli.script.Screen类的典型用法代码示例。如果您正苦于以下问题:Python Screen类的具体用法?Python Screen怎么用?Python Screen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Screen类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: selectRegion
def selectRegion(self, msg=None):
if msg:
r = JScreen.getPrimaryScreen().selectRegion(msg)
else:
r = JScreen.getPrimaryScreen().selectRegion()
if r:
return Region(r)
else:
return None
示例2: __init__
def __init__(self, id=None):
if DEBUG: print "**IN*** Jython INIT Screen"
if id != None:
r = JScreen.getBounds(id)
else:
r = JScreen.getBounds(JScreen.getPrimaryId())
(x, y, w, h) = (int(r.getX()), int(r.getY()), \
int(r.getWidth()), int(r.getHeight()))
Region.__init__(self, x, y, w, h)
self.setScriptingType("JythonScreen")
if DEBUG: print "**OUT** Jython INIT Screen"
示例3: __init__
def __init__(self, id=None):
try:
if id != None:
r = JScreen.getBounds(id)
s = JScreen.getScreen(id)
else:
id = JScreen.getPrimaryId()
r = JScreen.getBounds(id)
s = JScreen.getScreen(id)
(self.x, self.y, self.w, self.h) = (int(r.getX()), int(r.getY()), \
int(r.getWidth()), int(r.getHeight()))
self.initScreen(s)
except:
Debug.log(3, "Jython: init: exception while initializing Screen\n%s", sys.exc_info(0))
sys.exit(1)
示例4: use
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
示例5: use
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: 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
示例6: __init__
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)
示例7: capture
def capture(self, *args):
scr = JScreen.getPrimaryScreen()
if len(args) == 0:
simg = scr.userCapture("Select an image")
if simg:
return simg.getFile()
else:
return None
elif len(args) == 1:
if isinstance(args[0], (types.StringType, types.UnicodeType)):
simg = scr.userCapture(args[0])
if simg:
return simg.getFile()
else:
return None
else:
return scr.capture(args[0]).getFile()
elif len(args) == 4:
return scr.capture(args[0], args[1], args[2], args[3]).getFile()
else:
return None
示例8: reset
def reset():
JScreen.resetMonitors();
use();
ALL = JScreen.all()
示例9: dir
#Debug.log(3, "Sikuli: _exposeAllMethods: %s called from: %s", anyObject, theGlobals['__name__'])
tosave = []
if not saved:
saved = []
for name in dir(anyObject):
if name in exclude_list: continue
try:
if not inspect.ismethod(getattr(anyObject,name)): continue
except:
continue
if name[0] != '_' and name[:7] != 'super__':
try:
saved.remove(name)
except:
pass
tosave.append(name)
#print "added:", name
theGlobals[name] = eval("anyObject."+name)
if name == 'checkWith': Debug.log(3, "%s %s", name, str(dict[name])[1:])
for name in saved:
if name in theGlobals:
#print "removed:", name
theGlobals.pop(name)
return tosave
############### set SCREEN as primary screen at startup ################
use()
ALL = JScreen.all()
Debug.log(3, "Jython: sikuli: Sikuli: ending init")
示例10: reset
def reset():
JScreen.resetMonitors();
use();
ALL = SCREEN.all().getRegion()
示例11: getNumberScreens
def getNumberScreens(cls):
return JScreen.getNumberScreens()
示例12: dir
]
# Debug.log(3, "Sikuli: _exposeAllMethods: %s called from: %s", anyObject, theGlobals['__name__'])
tosave = []
if not saved:
saved = []
for name in dir(anyObject):
if name in exclude_list: continue
try:
if not inspect.ismethod(getattr(anyObject, name)): continue
except:
continue
if name[0] != '_' and name[:7] != 'super__':
try:
saved.remove(name)
except:
pass
tosave.append(name)
# print "added:", name
theGlobals[name] = eval("anyObject." + name)
if name == 'checkWith': Debug.log(3, "%s %s", name, str(dict[name])[1:])
for name in saved:
if name in theGlobals:
# print "removed:", name
theGlobals.pop(name)
return tosave
############### set SCREEN as primary screen at startup ################
use()
ALL = JScreen.all().getRegion()
Debug.log(3, "Jython: sikuli: Sikuli: ending init")