wip: add log when database is edited

This commit is contained in:
Cyrille L 2022-11-25 19:05:59 +01:00
parent 442d4c6c44
commit 3fbbfdfc1a
2 changed files with 5 additions and 2 deletions

View File

@ -137,13 +137,16 @@ def manage_wip(file_post, Force):
check.post_wip[0], check.post_wip[1])
tmp_post_wip = (hash_wip, time_wip)
post_wip = 'post_wip = %s'%str(tmp_post_wip)
print(rep_post_wip, '>>', post_wip)
# Replace post_wip in DB
with open(check.post_db, 'r') as file:
filedata = file.read()
filedata = filedata.replace(rep_post_wip, post_wip)
with open(check.post_db, 'w') as file:
file.write(filedata)
# log
msg_log = 'Edit Database: %s'%check.post_db
log.append_f(check.post_logs, msg_log, 0)
#============================#