本文整理汇总了Python中subscriber.Subscriber.get_all方法的典型用法代码示例。如果您正苦于以下问题:Python Subscriber.get_all方法的具体用法?Python Subscriber.get_all怎么用?Python Subscriber.get_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subscriber.Subscriber
的用法示例。
在下文中一共展示了Subscriber.get_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send_subscription_fee_notice
# 需要导入模块: from subscriber import Subscriber [as 别名]
# 或者: from subscriber.Subscriber import get_all [as 别名]
def send_subscription_fee_notice(self, msg):
# get all subscribers
try:
sub = Subscriber()
subscribers_list = sub.get_all()
except SubscriberException as e:
raise SubscriptionException('%s' % e)
sms = SMS()
for mysub in subscribers_list:
self.logger.debug("Send sms to %s %s" % (mysub[1], msg))
sms.send(config['smsc'],mysub[1], msg)
示例2: broadcast_to_all_subscribers
# 需要导入模块: from subscriber import Subscriber [as 别名]
# 或者: from subscriber.Subscriber import get_all [as 别名]
def broadcast_to_all_subscribers(self, text, btype):
sub = Subscriber()
if btype == 'all':
subscribers_list = sub.get_all()
elif btype == 'notpaid':
subscribers_list = sub.get_all_notpaid()
elif btype == 'unauthorized':
subscribers_list = sub.get_all_unauthorized()
elif btype == 'extension':
subscribers_list = sub.get_all_5digits()
for mysub in subscribers_list:
self.send(config['smsc'], mysub[1], text)
sms_log.debug('Broadcast message sent to %s' % mysub[1])
time.sleep(1)