web_server.py 文件源码

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

项目:shakecast 作者: usgs 项目源码 文件源码
def notification_html(notification_type, name):
    config = json.loads(request.args.get('config', 'null'))

    session = Session()
    not_builder = NotificationBuilder()

    if notification_type == 'new_event':
        # get the two most recent events
        events = session.query(Event).all()
        events = events[-2:]
        html = not_builder.build_new_event_html(events=events, name=name, web=True, config=config)
    else:
        # get the most recent shakemap
        sms = session.query(ShakeMap).all()
        sm = sms[-1]
        html = not_builder.build_insp_html(sm, name=name, web=True, config=config)
    Session.remove()
    return html
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号