viento_setup.py 文件源码

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

项目:viento 作者: tgsachse 项目源码 文件源码
def command_write():
    """
    Writes changes to file, and resets the change_count.
    """
    viento_utils.directories_check()
    with open(viento_utils.f_drafts, 'w') as f:
        json.dump(drafts, f)

    print(str(change_count.count) + " change", end='')
    if change_count.count != 1:
        print("s", end='')
    print(" saved to file.")
    viento_utils.log('file_write', args=[change_count.count,
                                         viento_utils.f_drafts])
    change_count.reset()
    try:
        with open(viento_utils.f_pid, 'r') as f:
            pid = int(f.read())
        os.kill(pid, signal.SIGUSR1)
    except FileNotFoundError:
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号