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
评论列表
文章目录