utils.py 文件源码

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

项目:pocket-cli 作者: rakanalh 项目源码 文件源码
def format_article(article, header=None, footer=None, line=False):
    content = ''
    if header:
        content = '{}\n'.format(header)
    if line:
        content += '{}\n'.format('=' * (get_terminal_size()[0]-1))

    content += '{} - {}\nReading Time: {} Mins\nURL: {}\n'.format(
        article['id'],
        article['title'] if article['title'] else '(No Title)',
        article['reading_time'],
        article['url']
    )

    if footer:
        content += footer

    return content
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号