本文整理汇总了Python中sender.Sender.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Sender.__init__方法的具体用法?Python Sender.__init__怎么用?Python Sender.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sender.Sender
的用法示例。
在下文中一共展示了Sender.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sender import Sender [as 别名]
# 或者: from sender.Sender import __init__ [as 别名]
def __init__(self, config, log):
Sender.__init__(self, config, log)
self.access_key = config.get('Messenger', 'gcm_access_key')
self.base_deeplink_url = config.get('Messenger', 'base_deeplink_url')
self.gcm = GCM(self.access_key)
self.canonical_ids = []
self.unregistered_devices = []
示例2: __init__
# 需要导入模块: from sender import Sender [as 别名]
# 或者: from sender.Sender import __init__ [as 别名]
def __init__(self, config, log):
Sender.__init__(self, config, log)
self.sandbox = config.getboolean('Messenger', 'apns_sandbox')
self.certificate_path = config.get('Messenger', 'apns_certificate_path')
self.topic = config.get('Messenger', 'apns_topic')
self.apn = APNsClient(self.certificate_path, use_sandbox=self.sandbox, log=log)
self.canonical_ids = []
self.unregistered_devices = []
示例3: __init__
# 需要导入模块: from sender import Sender [as 别名]
# 或者: from sender.Sender import __init__ [as 别名]
def __init__(self, config, log):
"""
APNs Push Sender uses MODIFIED (watch out if you want to update it) PyAPNs module: https://github.com/djacobs/PyAPNs
APNs documentation: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW4
"""
Sender.__init__(self, config, log)
self.sent_queue = {}
self.batch_size = int(config.get('Messenger', 'apns_batch_size'))
self.sandbox = config.get('Messenger', 'apns_sandbox') == 'true'
self.certificate_path = config.get('Messenger', 'apns_certificate_path')
set_logger(log)
self.apns = APNs(use_sandbox=self.sandbox, cert_file=self.certificate_path, enhanced=True,
write_retries=self.connection_error_retries)
self.apns.gateway_server.register_response_listener(self.process_malformed_notification)
self.apns.gateway_server.register_error_listener(self.process_failed_notification)
示例4: __init__
# 需要导入模块: from sender import Sender [as 别名]
# 或者: from sender.Sender import __init__ [as 别名]
def __init__(self, tsid, ssid):
Sender.__init__(self, tsid, ssid)
self.mid = ""
self.timer = Timer()
self.uid2player = {}
self.presenter = None
self.cache_billboard = {}
self.cc = CacheCenter(tsid, ssid)
self.mode = Question
self.idle_state = IdleState(self)
self.ready_state = ReadyState(self)
self.timing_state = TimingState(self)
self.timeup_state = TimeupState(self)
self.statistics_state = StatisticsState(self)
self.answer_state = AnswerState(self)
self.announce_state = AnnounceState(self)
self.award_state = AwardState(self)
self.ending_state = EndingState(self)
self.state = self.idle_state
self.SetState(self.idle_state)
self.loopGetBillboard()
示例5: __init__
# 需要导入模块: from sender import Sender [as 别名]
# 或者: from sender.Sender import __init__ [as 别名]
def __init__(self):
Sender.__init__(self, 0, 0)
self.ssid2room = {}
self.uid2ssid = {}
self.ssid2flag = {}
self.loadCache()
示例6: __init__
# 需要导入模块: from sender import Sender [as 别名]
# 或者: from sender.Sender import __init__ [as 别名]
def __init__(self, tsid, ssid):
Sender.__init__(self, tsid, ssid)
self.timer = Timer()
self.cc = CacheCenter(tsid, ssid)
self.reset(True)