当前位置: 首页>>代码示例>>Python>>正文


Python script.Screen类代码示例

本文整理汇总了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
开发者ID:sunchenglong,项目名称:SikuliX-2014,代码行数:9,代码来源:Screen.py

示例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"
开发者ID:freemantest123,项目名称:SikuliX-API,代码行数:11,代码来源:Screen.py

示例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)
开发者ID:AEtherSurfer,项目名称:SikuliX-Basics,代码行数:15,代码来源:Screen.py

示例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
开发者ID:Barath-81,项目名称:SikuliX-2014,代码行数:20,代码来源:Sikuli.py

示例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
开发者ID:RaiMan,项目名称:SikuliX-2014,代码行数:22,代码来源:Sikuli.py

示例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)
开发者ID:AndroidMarv,项目名称:sikuli,代码行数:8,代码来源:Screen.py

示例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
开发者ID:sunchenglong,项目名称:SikuliX-2014,代码行数:21,代码来源:Screen.py

示例8: reset

def reset():
  JScreen.resetMonitors();
  use();
  ALL = JScreen.all()
开发者ID:ElMachito,项目名称:SikuliX-2014,代码行数:4,代码来源:Sikuli.py

示例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")

开发者ID:ElMachito,项目名称:SikuliX-2014,代码行数:29,代码来源:Sikuli.py

示例10: reset

def reset():
  JScreen.resetMonitors();
  use();
  ALL = SCREEN.all().getRegion()
开发者ID:edlucero,项目名称:SikuliX-2014,代码行数:4,代码来源:Sikuli.py

示例11: getNumberScreens

 def getNumberScreens(cls):
     return JScreen.getNumberScreens()
开发者ID:Bug2014,项目名称:SikuliX-2014,代码行数:2,代码来源:Screen.py

示例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")
开发者ID:Barath-81,项目名称:SikuliX-2014,代码行数:30,代码来源:Sikuli.py

示例13: all

 def all(cls):
     return JScreen.all()
开发者ID:Barath-81,项目名称:SikuliX2,代码行数:2,代码来源:Screen.py


注:本文中的org.sikuli.script.Screen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。