当前位置: 首页>>代码示例>>Python>>正文


Python PushHelper.get_users_subscribed_to_event方法代码示例

本文整理汇总了Python中helpers.push_helper.PushHelper.get_users_subscribed_to_event方法的典型用法代码示例。如果您正苦于以下问题:Python PushHelper.get_users_subscribed_to_event方法的具体用法?Python PushHelper.get_users_subscribed_to_event怎么用?Python PushHelper.get_users_subscribed_to_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在helpers.push_helper.PushHelper的用法示例。


在下文中一共展示了PushHelper.get_users_subscribed_to_event方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: send_match_video

# 需要导入模块: from helpers.push_helper import PushHelper [as 别名]
# 或者: from helpers.push_helper.PushHelper import get_users_subscribed_to_event [as 别名]
 def send_match_video(cls, match):
     """
     Sends match_video and event_match_video notifications
     If the match is current, MatchVideoNotification is sent.
     Otherwise, EventMatchVideoNotification is sent
     """
     match_users = set(PushHelper.get_users_subscribed_to_match(match, NotificationType.MATCH_VIDEO))
     event_users = set(PushHelper.get_users_subscribed_to_event(match.event.get(), NotificationType.MATCH_VIDEO))
     users = match_users.union(event_users)
     if match.within_seconds(60*10):
         user_keys = PushHelper.get_client_ids_for_users(users)
         MatchVideoNotification(match).send(user_keys)
     else:
         user_keys = PushHelper.get_client_ids_for_users(users)
         EventMatchVideoNotification(match).send(user_keys)
开发者ID:MC42,项目名称:the-blue-alliance,代码行数:17,代码来源:notification_helper.py

示例2: send_award_update

# 需要导入模块: from helpers.push_helper import PushHelper [as 别名]
# 或者: from helpers.push_helper.PushHelper import get_users_subscribed_to_event [as 别名]
    def send_award_update(cls, event):
        users = PushHelper.get_users_subscribed_to_event(event, NotificationType.AWARDS)
        keys = PushHelper.get_client_ids_for_users(users)

        notification = AwardsUpdatedNotification(event)
        notification.send(keys)
开发者ID:arilotter,项目名称:the-blue-alliance,代码行数:8,代码来源:notification_helper.py

示例3: send_schedule_update

# 需要导入模块: from helpers.push_helper import PushHelper [as 别名]
# 或者: from helpers.push_helper.PushHelper import get_users_subscribed_to_event [as 别名]
    def send_schedule_update(cls, event):
        users = PushHelper.get_users_subscribed_to_event(event, NotificationType.SCHEDULE_UPDATED)
        keys = PushHelper.get_client_ids_for_users(users)

        notification = ScheduleUpdatedNotification(event)
        notification.send(keys)
开发者ID:arilotter,项目名称:the-blue-alliance,代码行数:8,代码来源:notification_helper.py


注:本文中的helpers.push_helper.PushHelper.get_users_subscribed_to_event方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。