本文整理汇总了Python中event.Event.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Event.__init__方法的具体用法?Python Event.__init__怎么用?Python Event.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类event.Event
的用法示例。
在下文中一共展示了Event.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, bot, raw):
Event.__init__(self, bot, raw)
if not self.is_a(*UPDATE_EVENTS):
self.channel = models.Channel(self.raw["channel"])
else:
self.channel = bot.get_channel(self.raw["channel"])
示例2: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, url, app_key, app_secret, group_name='default', query_message_interval=50, heartbeat_interval=30,
sdk_version='top-sdk-java-201403304', *args, **kwargs):
super(TmcClient, self).__init__(url, *args, **kwargs)
Event.__init__(self)
self.on('on_init', lambda: logger.info('WebSocket Start Connect: %[email protected]%s' % (url, group_name)))
assert isinstance(url, (str, unicode)) and len(url) > 0
assert isinstance(app_key, (str, unicode)) and len(app_key) > 0
assert isinstance(app_secret, (str, unicode)) and len(app_secret) > 0
assert isinstance(group_name, (str, unicode)) and len(group_name) > 0
assert isinstance(query_message_interval, int) and 0 < query_message_interval < 60
assert isinstance(heartbeat_interval, int) and 0 < heartbeat_interval < 60
self.sdk_version = sdk_version
self.url = url
self.app_secret = app_secret
self.app_key = app_key
self.group_name = group_name
self.query_message_interval = query_message_interval
self.heartbeat_interval = heartbeat_interval
self.token = None
self.fire('on_init')
self.on('on_handshake_success', self._start_query_loop)
self.on('on_confirm_message', self._on_confirm_message)
示例3: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, etype, bubbles=True, cancelable=False,
relatedObject=None, shiftKey=None, keyCode=0,
direction='none'):
Event.__init__(self, etype, bubbles, cancelable)
self.relatedObject = relatedObject
self.keyCode = keyCode
self.shiftKey = shiftKey
示例4: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, *args, **kwargs):
"""Stores t2 and channel and passes to Event.__init__"""
# Store items:
if "dur" in kwargs:
self.dur = kwargs.pop("dur")
else:
self.dur = timedelta(0, 0, 0)
# Refer to parent:
Event.__init__(self, *args, **kwargs)
示例5: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__( self, id, user = None, subscriptionSource = None, resourceUri = None, event = None, contentType = None, expires = None, silent = False ):
Event.__init__( self, id )
self.user = user
self.subscriptionSource = subscriptionSource
self.resourceUri = resourceUri
self.event = event
self.contentType = contentType
self.expires = expires
self.silent = silent
示例6: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__( self , *args , **kwargs ):
"""Doesn't do much"""
# Retrieve argument intended for here:
if "colour" in kwargs:
self.colour = kwargs.pop("colour")
else:
self.colour = 'b'
if "times" in kwargs:
self.times = kwargs.pop("times")
Event.__init__( self , *args , **kwargs )
# Find times if not provided:
if not hasattr( self , "times" ) :
self.times , self.chans = self.GetPeaks( self.t )
示例7: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, bot, raw):
Event.__init__(self, bot, raw)
self.emoji = raw["reaction"]
self.reaction_type = raw["item"]["type"]
if bot:
self.user = bot.get_user(raw.get("user", ""))
else:
self.user = raw.get("user", "")
if self.reaction_type == "message":
self.target = bot.get_channel(raw["item"]["channel"]) if bot else raw["item"]["channel"]
else:
self.target = raw["item"]["file"]
示例8: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, etype, bubbles=False, cancelable=False,
charCodeValue=0, keyCodeValue=0, keyLocationValue=0,
ctrlKeyValue=False, altKeyValue=False,
shiftKeyValue=False, controlKeyValue=False,
commandKeyValue=False):
Event.__init__(self, etype, bubbles, cancelable)
self.keyCode = keyCodeValue
self.keyLocation = keyLocationValue
self.charCode = charCodeValue
self.shiftKey = shiftKeyValue
self.altKey = altKeyValue
self.controlKey = controlKeyValue
self.commandKey = commandKeyValue
self.ctrlKey = ctrlKeyValue or self.controlKey or self.commandKey
示例9: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, etype, bubbles=True, cancelable=False,
localX=0.0, localY=0.0, relatedObject=None,
ctrlKey=False, altKey=False, shiftKey=False,
buttonDown=False, delta=0, commandKey=False,
clickCount=0):
Event.__init__(self, etype, bubbles, cancelable=True)
self.localX = float(localX)
self.localY = float(localY)
self.relatedObject = relatedObject
self.ctrlKey = ctrlKey
self.altKey = altKey
self.shiftKey = shiftKey
self.buttonDown = buttonDown
self.delta = delta
self.commandKey = commandKey
self.clickCount = clickCount
self.stageX = 0.0
self.stageY = 0.0
示例10: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, source, status):
Event.__init__(self, "StatusEvent")
self.source = source
self.status = status
示例11: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, name, value, replay = False):
Event.__init__(self, "PropertyChangeEvent")
self.name = name
self.value = value
self.replay = replay
示例12: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, status):
Event.__init__(self, "HeaterCommandEvent")
self.status = status
示例13: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, bot, raw):
Event.__init__(self, bot, raw)
self.file = models.File(self.raw["file"]) if "file" in self.raw \
else None
示例14: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, source, msg):
self.message = msg
Event.__init__(self, source)
示例15: __init__
# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import __init__ [as 别名]
def __init__(self, time, group, index):
Event.__init__(self, time)
self.elevator_group = group
self.elevator_index = index