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


Python Job.Job类代码示例

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


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

示例1: __init__

    def __init__(self, name, firstCheckDelay = None):
        Job.__init__(self, name)
        self._serialNum = serialNum()

        self._findContainersJob = None
        self._checkContainersJob = None
        self._pruneContainersJob = None

        if firstCheckDelay is None:
            firstCheckDelay = 60. * 15.
        # divide by two, since the first check just takes length measurements and
        # doesn't check for leaks
        self._nextCheckDelay = firstCheckDelay/2.
        self._checkDelayScale = config.GetFloat('leak-detector-check-delay-scale', 1.5)
        self._pruneTaskPeriod = config.GetFloat('leak-detector-prune-period', 60. * 30.)

        # main dict of id(container)->containerRef
        self._id2ref = {}
        # storage for results of check-container job
        self._index2containerId2len = {}
        self._index2delay = {}

        if config.GetBool('leak-container', 0):
            _createContainerLeak()
        if config.GetBool('leak-tasks', 0):
            _createTaskLeak()

        # don't check our own tables for leaks
        ContainerLeakDetector.addPrivateObj(ContainerLeakDetector.PrivateIds)
        ContainerLeakDetector.addPrivateObj(self.__dict__)

        self.setPriority(Job.Priorities.Min)
        jobMgr.add(self)
开发者ID:Oldtiger5,项目名称:panda3d,代码行数:33,代码来源:ContainerLeakDetector.py

示例2: __init__

 def __init__(self, obj, maxRefs = 100):
     Job.__init__(self, 'ReferrerSearch')
     self.obj = obj
     self.maxRefs = maxRefs
     self.visited = set()
     self.depth = 0
     self.found = 0
     self.shouldPrintStats = False
开发者ID:AdrianF98,项目名称:Toontown-2-Revised,代码行数:8,代码来源:ReferrerSearch.py

示例3: __init__

 def __init__(self, name, log = False, limit = None, threaded = False):
     Job.__init__(self, name)
     self._log = log
     self._limit = limit
     self._visitedIds = set()
     self._id2pathStr = {}
     self._id2container = {}
     self._type2id2len = {}
     self._instanceDictIds = set()
     self._queue = Queue()
     jobMgr.add(self)
     if threaded == False:
         jobMgr.finish(self)
开发者ID:MasterLoopyBM,项目名称:c0d3,代码行数:13,代码来源:ContainerReport.pyc.py

示例4: __init__

 def __init__(self, name, log=False, limit=None, threaded=False):
     Job.__init__(self, name)
     self._log = log
     self._limit = limit
     # set up our data structures
     self._visitedIds = set()
     self._id2pathStr = {}
     self._id2container = {}
     self._type2id2len = {}
     self._instanceDictIds = set()
     # for breadth-first searching
     self._queue = Queue()
     jobMgr.add(self)
     if threaded == False:
         jobMgr.finish(self)
开发者ID:FelixBucket,项目名称:ToontownFritzServer,代码行数:15,代码来源:ContainerReport.py

示例5: __init__

 def __init__(self, name, log=True, verbose=False, fullReport=False, findCycles=True,
              threaded=False, doneCallback=None, autoDestroy=False, priority=None):
     # if autoDestroy is True, GarbageReport will self-destroy after logging
     # if false, caller is responsible for calling destroy()
     # if threaded is True, processing will be performed over multiple frames
     Job.__init__(self, name)
     # stick the arguments onto a ScratchPad so we can delete them all at once
     self._args = ScratchPad(name=name, log=log, verbose=verbose, fullReport=fullReport,
                             findCycles=findCycles, doneCallback=doneCallback,
                             autoDestroy=autoDestroy)
     if priority is not None:
         self.setPriority(priority)
     jobMgr.add(self)
     if not threaded:
         jobMgr.finish(self)
开发者ID:Toonerz,项目名称:TTRInjector,代码行数:15,代码来源:GarbageReport.py

示例6: destroy

 def destroy(self):
     #print 'GarbageReport.destroy'
     del self._args
     del self.garbage
     # don't get rid of this, we might need it
     #del self.numGarbage
     del self.referrersByReference
     del self.referrersByNumber
     del self.referentsByReference
     del self.referentsByNumber
     if hasattr(self, 'cycles'):
         del self.cycles
     del self._report
     if hasattr(self, '_reportStr'):
         del self._reportStr
     Job.destroy(self)
开发者ID:Toonerz,项目名称:TTRInjector,代码行数:16,代码来源:GarbageReport.py

示例7: __init__

 def __init__(self, name):
     Job.__init__(self, name)
     self.setPriority(Job.Priorities.Normal*2)
     jobMgr.add(self)
开发者ID:AdrianF98,项目名称:Toontown-2-Revised,代码行数:4,代码来源:MessengerLeakDetector.py

示例8: finished

 def finished(self):
     Job.finished(self)
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:2,代码来源:LeakDetectors.py

示例9: destroy

 def destroy(self):
     self._doneCallback = None
     Job.destroy(self)
     return
开发者ID:MasterLoopyBM,项目名称:c0d3,代码行数:4,代码来源:ObjectCount.pyc.py

示例10: __init__

 def __init__(self, creator):
     Job.__init__(self, uniqueName(typeName(self)))
     self._creator = creator
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:3,代码来源:LeakDetectors.py

示例11: destroy

 def destroy(self):
     self._creator = None
     Job.destroy(self)
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:3,代码来源:LeakDetectors.py

示例12: __init__

 def __init__(self, name, immediate = False, doneCallback = None):
     Job.__init__(self, name)
     self._doneCallback = doneCallback
     jobMgr.add(self)
     if immediate:
         jobMgr.finish(self)
开发者ID:MasterLoopyBM,项目名称:c0d3,代码行数:6,代码来源:ObjectCount.pyc.py

示例13: __init__

 def __init__(self):
     Job.__init__(self, 'TestJob')
     self._counter = 0
     self._accum = 0
     self._finished = False
开发者ID:FelixBucket,项目名称:ToontownFritzServer,代码行数:5,代码来源:Job.py

示例14: destroy

 def destroy(self):
     self.ignore(self._ldde)
     self._leakDetector = None
     self._doneCallback = None
     ContainerLeakDetector.removePrivateObj(self.__dict__)
     Job.destroy(self)
开发者ID:Oldtiger5,项目名称:panda3d,代码行数:6,代码来源:ContainerLeakDetector.py


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