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


Python basics.Debug类代码示例

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


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

示例1: _exposeAllMethods

def _exposeAllMethods(anyObject, saved, theGlobals, exclude_list):
    if not exclude_list:
        exclude_list = [ 'class', 'classDictInit', 'clone', 'equals', 'finalize',
                    'getClass', 'hashCode', 'notify', 'notifyAll',
                    'toGlobalCoord', 'toString', 'getLocationFromPSRML', 'getRegionFromPSRM',
                   'capture', 'selectRegion', 'create', 'observeInBackground', 'waitAll',
                    'updateSelf', 'findNow', 'findAllNow', 'getEventManager',
                    'lastMatch', 'lastMatches', 'lastScreenImage', 'lastScreenImageFile']
    #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
开发者ID:ElMachito,项目名称:SikuliX-2014,代码行数:32,代码来源:Sikuli.py

示例2: _exposeAllMethods

def _exposeAllMethods(anyObject, saved, theGlobals, exclude_list):
    if not exclude_list:
        exclude_list = [
            "class",
            "classDictInit",
            "clone",
            "equals",
            "finalize",
            "getClass",
            "hashCode",
            "notify",
            "notifyAll",
            "toGlobalCoord",
            "toString",
            "getLocationFromPSRML",
            "getRegionFromPSRM",
            "capture",
            "selectRegion",
            "create",
            "observeInBackground",
            "waitAll",
            "updateSelf",
            "findNow",
            "findAllNow",
            "getEventManager",
            "lastMatch",
            "lastMatches",
            "lastScreenImage",
            "lastScreenImageFile",
        ]
    # 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
开发者ID:barryyz,项目名称:SikuliX2,代码行数:57,代码来源:Sikuli.py

示例3: initSikuli

def initSikuli(scr = None):
    dict = globals()
    dict['METHODCATALOG'] = sys.modules[__name__].__dict__
    if scr == None:
        Debug.log(3, "Jython: init SCREEN as ()")
        dict['SCREEN'] = Screen()
    else:
        Debug.log(3, "Jython: init SCREEN as", scr)
        dict['SCREEN'] = Screen(scr) 
    dict['SCREEN']._exposeAllMethods(__name__)
开发者ID:AEtherSurfer,项目名称:SikuliX-Basics,代码行数:10,代码来源:Sikuli.py

示例4: observe

 def observe(self, time=FOREVER, background=False):
     if not background:
         return JRegion.observe(self, time)
     else:
         if(self.getEvtMgr()) == None:
             Debug.error("Jython Region: observe: nothing to observe")
             return None
         else:
             r = (JRegion(self))
             e = self.getEvtMgr()
             e.setRegion(r)
             r.setEvtMgr(e)
             r.setObserveScanRate(self.getObserveScanRate())
             return r.observeInBackground(time)
开发者ID:AEtherSurfer,项目名称:SikuliX-Basics,代码行数:14,代码来源:Region.py

示例5: __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

示例6: _exposeAllMethods

 def _exposeAllMethods(self, mod):
     exclude_list = [ 'class', 'classDictInit', 'clone', 'equals', 'finalize',
                     'getClass', 'hashCode', 'notify', 'notifyAll',
                     'toGlobalCoord', 'toString', 'getLocationFromPSRML', 'getRegionFromPSRM',
                    'capture', 'selectRegion', 'create', 'observeInBackground', 'waitAll',
                     'updateSelf', 'findNow', 'findAllNow', 'getEventManager']
     dict = sys.modules[mod].__dict__
     for name in dir(self):
         if name in exclude_list: continue
         try:
             if not inspect.ismethod(getattr(self,name)): continue
         except:
             continue
         if name[0] != '_' and name[:7] != 'super__':
             dict[name] = eval("self."+name)
             if name == 'checkWith': Debug.log(3, "%s %s", name, str(dict[name])[1:])
开发者ID:AEtherSurfer,项目名称:SikuliX-Basics,代码行数:16,代码来源:Screen.py

示例7: find_module

 def find_module(self, module_name, package_path):
     if _debug(): print "SikuliImporter.find_module", module_name, package_path
     module_name = _stripPackagePrefix(module_name)
     if module_name[0:1] == "*": 
         return None
     if package_path:
         paths = package_path
     else:
         paths = sys.path
     for path in paths:
         mod = self._find_module(module_name, path)
         if mod:
             return mod
     if Sikuli.load(module_name +".jar"):
         Debug.log(2,module_name + ".jar loaded")
         return None
     return None
开发者ID:niknah,项目名称:SikuliX-2014,代码行数:17,代码来源:SikuliImporter.py

示例8: use

def use(scr = None, remote = False):
  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 = Screen()
  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:ElMachito,项目名称:SikuliX-2014,代码行数:19,代码来源:Sikuli.py

示例9:

# Copyright 2010-2013, Sikuli.org
# Released under the MIT License.
# modified RaiMan 2013

from __future__ import with_statement
from org.sikuli.basics import Debug
Debug.log(3, "Jython: sikuli: Sikuli: starting init")
import time
import __builtin__
import __main__
import types
import sys
import os
import inspect

Debug.log(4, "Jython: sikuli: Sikuli: constants")
import org.sikuli.script.FindFailed as FindFailed
from org.sikuli.script.FindFailedResponse import *
from org.sikuli.script.Constants import *
import org.sikuli.script.Button as Button
from org.sikuli.script.Button import WHEEL_UP, WHEEL_DOWN
from org.sikuli.basics import OS

Debug.log(4, "Jython: sikuli: Sikuli: import Region")
from org.sikuli.script import Region as JRegion
from Region import *
from org.sikuli.script import Observing

Debug.log(4, "Jython: sikuli: Sikuli: import Screen")
from org.sikuli.script import Screen as JScreen
from Screen import *
开发者ID:ElMachito,项目名称:SikuliX-2014,代码行数:31,代码来源:Sikuli.py

示例10:

# Copyright 2010-2013, Sikuli.org
# Released under the MIT License.
# modified RaiMan 2013

from org.sikuli.basics import Debug

Debug.log(3, "Jython: sikuli: __init__: entering")
from Sikuli import *
开发者ID:BernieLiu,项目名称:SikuliX-2014,代码行数:8,代码来源:__init__.py

示例11:

# Copyright 2010-2013, Sikuli.org
# Released under the MIT License.
# modified RaiMan 2013

from __future__ import with_statement
from org.sikuli.basics import Debug
Debug.log(3, "Jython: sikuli: Sikuli: entering")
import time
import __builtin__
import __main__
import types
import sys
import os

Debug.log(3, "Jython: sikuli: Sikuli: constants")
import org.sikuli.script.FindFailed as FindFailed
from org.sikuli.script.FindFailedResponse import *
from org.sikuli.script.Constants import *
import org.sikuli.script.Button as Button
from org.sikuli.script.Button import WHEEL_UP, WHEEL_DOWN
from org.sikuli.basics import OS

Debug.log(3, "Jython: sikuli: Sikuli: import Region")
from org.sikuli.script import Region as JRegion
from Region import *

Debug.log(3, "Jython: sikuli: Sikuli: import Screen")
from org.sikuli.script import Screen as JScreen
from Screen import *

Debug.log(3, "Jython: sikuli: Sikuli: Env.addHotkey")
开发者ID:AEtherSurfer,项目名称:SikuliX-Basics,代码行数:31,代码来源:Sikuli.py

示例12: _debug

def _debug():
  if Debug.getDebugLevel() > 3:
    return True
  else:
    return False;
开发者ID:niknah,项目名称:SikuliX-2014,代码行数:5,代码来源:SikuliImporter.py


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