本文整理汇总了Python中twisted.internet.selectreactor.SelectReactor.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SelectReactor.__init__方法的具体用法?Python SelectReactor.__init__怎么用?Python SelectReactor.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.internet.selectreactor.SelectReactor
的用法示例。
在下文中一共展示了SelectReactor.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twisted.internet.selectreactor import SelectReactor [as 别名]
# 或者: from twisted.internet.selectreactor.SelectReactor import __init__ [as 别名]
def __init__(self):
SelectReactor.__init__(self)
self.paused = False
self._return_value = None
self._release_requested = False
self._mainLoopGen = None
# Older versions of twisted do not have the _started attribute, make it a synonym for running in that case
if not hasattr(self, '_started'):
PausingReactor._started = property(lambda self: self.running)
示例2: __init__
# 需要导入模块: from twisted.internet.selectreactor import SelectReactor [as 别名]
# 或者: from twisted.internet.selectreactor.SelectReactor import __init__ [as 别名]
def __init__(self, tempo=130, meters=(), reactor=None):
self.tempo = tempo
self.ticks = 0
# self.setTempo(tempo)
self._tick_interval = (60.0 / tempo) * (1.0 / 24)
self.meters = meters
self._meter_schedule = {}
if not self.meters:
self.meters = [Meter(4, 4, 1)]
if not reactor:
from twisted.internet import reactor
self.reactor = reactor
SelectReactor.__init__(self)
示例3: __init__
# 需要导入模块: from twisted.internet.selectreactor import SelectReactor [as 别名]
# 或者: from twisted.internet.selectreactor.SelectReactor import __init__ [as 别名]
def __init__(self, tempo=TEMPO_120_24, meter=None, meters=(), reactor=None,
syncClockClass=None, default=False):
"""
tempo: The tempo object (default: Tempo(120, 24))
meter: Meter used by the clock - default to Meter(4,4,tempo=tempo)
reactor: The underlying reactor to drive this BeatClock - this defaults
to the global reactor (i.e "from twisted.internet import
reactor")
syncClockClass: SyncClock class to use for synchronizing the clock's
ticks and scheduling offset (if None, no SyncClock will be used).
See bl.sync.
default: If True, BeatClock.defaultClock will be set to the instance -
this is used by other components to get the default global
BeatClock.
"""
global clock
self.tempo = tempo
self.ticks = 0
self.meters = meters
self._meter_schedule = {}
if not self.meters:
self.meters = [Meter(4, 4, 1, tempo=self.tempo)]
else:
warnings.warn('meters argument is deprecated, use '
'meter=oneMeterNotAList instead')
self.meter = meter or self.meters[0]
if not reactor:
from twisted.internet import reactor
self.reactor = reactor
if default or (self.defaultClock is None):
BeatClock.defaultClock = self
clock = self
if syncClockClass:
self.syncClock = syncClockClass(self)
lasttick, ts = self.syncClock.lastTick()
self.ticks = lasttick
SelectReactor.__init__(self)
示例4: __init__
# 需要导入模块: from twisted.internet.selectreactor import SelectReactor [as 别名]
# 或者: from twisted.internet.selectreactor.SelectReactor import __init__ [as 别名]
def __init__(self, *args):
SelectReactor.__init__(self, *args)
self._releaseRequested = False
self._mainLoopGen = None
示例5: __init__
# 需要导入模块: from twisted.internet.selectreactor import SelectReactor [as 别名]
# 或者: from twisted.internet.selectreactor.SelectReactor import __init__ [as 别名]
def __init__(self):
SelectReactor.__init__(self)
WmiReactorMixin.__init__(self)
示例6: __init__
# 需要导入模块: from twisted.internet.selectreactor import SelectReactor [as 别名]
# 或者: from twisted.internet.selectreactor.SelectReactor import __init__ [as 别名]
def __init__(self):
SelectReactor.__init__(self)
self.loopCall = lambda: None
示例7: __init__
# 需要导入模块: from twisted.internet.selectreactor import SelectReactor [as 别名]
# 或者: from twisted.internet.selectreactor.SelectReactor import __init__ [as 别名]
def __init__(self):
SelectReactor.__init__(self)
connection = self.connectTCP('localhost', 8000, factory)
pygame_test.prepare()
installReactor(self)