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

@ -1211,7 +1211,7 @@ def create_DB(post_db):
# log # log
msg_log = 'Create Database: %s'%post_db msg_log = 'Create Database: %s'%post_db
log.append_f(post_logs,msg_log,0) log.append_f(post_logs, msg_log, 0)
# Main Post Conf # Main Post Conf
lines_conf = ( lines_conf = (

View File

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