dashboard.py 文件源码

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

项目:n1mm_view 作者: n1kdo 项目源码 文件源码
def update_crawl_message(crawl_messages):
    crawl_messages.set_message(0, config.EVENT_NAME)
    crawl_messages.set_message_colors(0, graphics.BRIGHT_BLUE, graphics.BLACK)
    now = datetime.utcnow()
    crawl_messages.set_message(1, datetime.strftime(now, '%H:%M:%S'))
    if now < config.EVENT_START_TIME:
        delta = config.EVENT_START_TIME - now
        seconds = delta.total_seconds()
        bg = graphics.BLUE if seconds > 3600 else graphics.RED
        crawl_messages.set_message(2, '%s starts in %s' % (config.EVENT_NAME, delta_time_to_string(delta)))
        crawl_messages.set_message_colors(2, graphics.WHITE, bg)
    elif now < config.EVENT_END_TIME:
        delta = config.EVENT_END_TIME - now
        seconds = delta.total_seconds()
        fg = graphics.YELLOW if seconds > 3600 else graphics.ORANGE
        crawl_messages.set_message(2, '%s ends in %s' % (config.EVENT_NAME, delta_time_to_string(delta)))
        crawl_messages.set_message_colors(2, fg, graphics.BLACK)
    else:
        crawl_messages.set_message(2, '%s is over.' % config.EVENT_NAME)
        crawl_messages.set_message_colors(2, graphics.RED, graphics.BLACK)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号