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


Python script.Region类代码示例

本文整理汇总了Python中org.sikuli.script.Region的典型用法代码示例。如果您正苦于以下问题:Python Region类的具体用法?Python Region怎么用?Python Region使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Region类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, *args):
    if len(args)==4:
       JRegion.__init__(self, args[0], args[1], args[2], args[3])
    elif len(args)==1:
       JRegion.__init__(self, args[0])
    else:
       raise Exception("Wrong number of parameters of Region's contructor")
开发者ID:ck1125,项目名称:sikuli,代码行数:7,代码来源:Region.py

示例2: wait

 def wait(self, target, timeout=None):
     if isinstance(target, int) or isinstance(target, long):
         target = float(target)
     if timeout == None:
         return JRegion.wait(self, target)
     else:
         return JRegion.wait(self, target, timeout)
开发者ID:Acidburn0zzz,项目名称:SikuliX-2014,代码行数:7,代码来源:Region.py

示例3: type

 def type(self, *args):
    if len(args) == 1:
       return JRegion.type(self, None, args[0], 0)
    if len(args) == 2:
       if __builtin__.type(args[1]) is types.IntType:
          return JRegion.type(self, None, args[0], args[1])
       else:
          return JRegion.type(self, args[0], args[1], 0)
    return JRegion.type(self, args[0], args[1], args[2])
开发者ID:ck1125,项目名称:sikuli,代码行数:9,代码来源:Region.py

示例4: wait

 def wait(self, target, timeout=None):
    if isinstance(target, int) or isinstance(target, long) or isinstance(target, float):
       time.sleep(target)
       return
    if timeout == None:
       ret = JRegion.wait(self, target)
    else:
       ret = JRegion.wait(self, target, timeout)
    return ret
开发者ID:eric011,项目名称:Sikuli12.11,代码行数:9,代码来源:Region.py

示例5: wait

 def wait(self, target, timeout=None):
    ttype = __builtin__.type(target)
    if ttype is types.IntType or ttype is types.FloatType:
       time.sleep(target)
       return
    if timeout == None:
       ret = JRegion.wait(self, target)
    else:
       ret = JRegion.wait(self, target, timeout)
    return ret
开发者ID:ck1125,项目名称:sikuli,代码行数:10,代码来源:Region.py

示例6: __init__

 def __init__(self, *args):
    if DEBUG: print "**IN*** Jython INIT Region"
    if len(args)==4:
       JRegion.__init__(self, args[0], args[1], args[2], args[3])
    elif len(args)==1:
       JRegion.__init__(self, args[0])
    else:
       raise Exception("Wrong number of parameters of Region's contructor")
    self.setScriptingType("JythonRegion")
    self._global_funcs = None
    if DEBUG: print "**OUT** Jython INIT Region"
开发者ID:eric011,项目名称:Sikuli12.11,代码行数:11,代码来源:Region.py

示例7: onChange

 def onChange(self, arg1, arg2=None):
    t_arg1 = __builtin__.type(arg1)
    if t_arg1 is types.IntType:
       min_size = arg1
       handler = arg2
    else:
       min_size = None
       handler = arg1
    class AnonyObserver(SikuliEventAdapter):
       def targetChanged(self, event):
          handler(event)
    if min_size != None:
       return JRegion.onChange(self, min_size, AnonyObserver())
    return JRegion.onChange(self, AnonyObserver())
开发者ID:eric011,项目名称:Sikuli12.11,代码行数:14,代码来源:Region.py

示例8: click

	def click(self, target, modifiers=0):
		try:
			return SikuliRegion.click(self, target, modifiers)
		except FindFailed, e:			
			self.log.html_img("Find Filed", "images/" + getFilename(target))
			self.log.screenshot(msg="Region", region=(self.getX(), self.getY(), self.getW(), self.getH()))
			raise e
开发者ID:XiaokunHou,项目名称:Sikuli-and-Robot-Framework-Integration,代码行数:7,代码来源:sikuliwrapper.py

示例9: dragDrop

 def dragDrop(self,src, dest, modifiers=0):
     try:
         return SikuliRegion.dragDrop(self,src, dest, modifiers)
     except FindFailed, e:            
         self.log.html_img("Find Filed", getFilename(src)+" or " + getFilename(src))
         self.log.screenshot(msg="Region", region=(self.getX(), self.getY(), self.getW(), self.getH()))
         raise e        
开发者ID:XiaokunHou,项目名称:Sikuli-and-Robot-Framework-Integration,代码行数:7,代码来源:sikuliwrapperU.py

示例10: doubleclick

 def doubleclick(self,target,modifiers=0):
     addFoundImage(getFilename(target)) 
     try:
         return SikuliRegion.doubleClick(self, target, modifiers)
     except FindFailed, e:            
         self.log.html_img("Find Filed", getFilename(target)) #"images/" + getFilename(target))
         self.log.screenshot(msg="Region", region=(self.getX(), self.getY(), self.getW(), self.getH()))
         raise e  
开发者ID:XiaokunHou,项目名称:Sikuli-and-Robot-Framework-Integration,代码行数:8,代码来源:sikuliwrapperU.py

示例11: mouseMove

 def mouseMove(self,target): 
     addFoundImage(getFilename(target))  
     try:
         return SikuliRegion.mouseMove(self,target)
     except FindFailed, e:            
         self.log.html_img("Find Filed", getFilename(target)) #"images/" + getFilename(target))
         self.log.screenshot(msg="Region", region=(self.getX(), self.getY(), self.getW(), self.getH()))
         raise e   
开发者ID:XiaokunHou,项目名称:Sikuli-and-Robot-Framework-Integration,代码行数:8,代码来源:sikuliwrapperU.py

示例12: onChange

    def onChange(self, arg1, arg2=None):

        if isinstance(arg1, int):
            min_size = arg1
            handler = arg2
        else:
            if (arg2 != None):
                raise Exception("onChange: Invalid parameters set")
            min_size = None
            handler = arg1
        
        class AnonyObserver(SikuliEventAdapter):
            def targetChanged(self, event):
                handler(event)
                
        if min_size != None:
            return JRegion.onChange(self, min_size, AnonyObserver())
        return JRegion.onChange(self, AnonyObserver())
开发者ID:AEtherSurfer,项目名称:SikuliX-Basics,代码行数:18,代码来源:Region.py

示例13: paste

 def paste(self, *args):
    if len(args) == 1:
       target = None
       s = args[0]
    elif len(args) == 2:
       target = args[0]
       s = args[1]
    if isinstance(s, types.StringType):
       s = java.lang.String(s, "utf-8")
    return JRegion.paste(self, target, s)
开发者ID:eric011,项目名称:Sikuli12.11,代码行数:10,代码来源:Region.py

示例14: _adjustRegion

def _adjustRegion(r_, offset = (0,0), expand=(0,0,0,0)):
    
    r = Region(r_)
    
    # Offset
    (dx,dy) = offset
    r.x += dx
    r.y += dy
    
    # Expansion
    if isinstance(expand, tuple):
        (dt,dl,db,dr) = expand
    else:
        (dt,dl,db,dr) = (expand,expand,expand,expand)

    r.x -= dl
    r.y -= dt
    r.w = r.w + dl + dr
    r.h = r.h + dt + db
    
    return r
开发者ID:AndroidMarv,项目名称:sikuli,代码行数:21,代码来源:guide.py

示例15: testToJythonRegion

 def testToJythonRegion(self):
    jr = JRegion(0, 0, 100, 100)
    pyr = JRegion.toJythonRegion(jr)
    self.assertEqual(jr.x, pyr.x)
    self.assertEqual(jr.y, pyr.y)
    self.assertEqual(jr.w, pyr.w)
    self.assertEqual(jr.h, pyr.h)
    try:
       with jr:
          self.fail("should not happen: __exit__ is not defined in Java.")
    except AttributeError,e:
       pass
开发者ID:AndroidMarv,项目名称:sikuli,代码行数:12,代码来源:test_pyregion.py


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