本文整理汇总了Python中direct.showbase.Job.Job.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Job.__init__方法的具体用法?Python Job.__init__怎么用?Python Job.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.showbase.Job.Job
的用法示例。
在下文中一共展示了Job.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
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)
示例2: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
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
示例3: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
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)
示例4: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
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)
示例5: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
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)
示例6: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
def __init__(self, name):
Job.__init__(self, name)
self.setPriority(Job.Priorities.Normal*2)
jobMgr.add(self)
示例7: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
def __init__(self, creator):
Job.__init__(self, uniqueName(typeName(self)))
self._creator = creator
示例8: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
def __init__(self):
Job.__init__(self, 'TestJob')
self._counter = 0
self._accum = 0
self._finished = False
示例9: __init__
# 需要导入模块: from direct.showbase.Job import Job [as 别名]
# 或者: from direct.showbase.Job.Job import __init__ [as 别名]
def __init__(self, name, immediate = False, doneCallback = None):
Job.__init__(self, name)
self._doneCallback = doneCallback
jobMgr.add(self)
if immediate:
jobMgr.finish(self)