contact.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:irisett 作者: beebyte 项目源码 文件源码
def get_contact_dict_for_active_monitor(dbcon: DBConnection, monitor_id: int) -> Dict[str, set]:
    """Get all contact addresses/numbers for a specific active monitor.

    Return: Dict[str, Set(str)] for 'email' and 'phone'.
    """
    ret = {
        'email': set(),
        'phone': set(),
    }  # type: Dict[str, set]

    contacts = await get_all_contacts_for_active_monitor(dbcon, monitor_id)
    for contact in contacts:
        if contact.email:
            ret['email'].add(contact.email)
        if contact.phone:
            ret['phone'].add(contact.phone)
    return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号