From 3fbbfdfc1a3ba7eccba72b06f6896265f969b121 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Fri, 25 Nov 2022 19:05:59 +0100 Subject: [PATCH] wip: add log when database is edited --- src/var/lib/tyto/program/check.py | 2 +- src/var/lib/tyto/program/wip.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 2783c30..8353657 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -1211,7 +1211,7 @@ def create_DB(post_db): # log 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 lines_conf = ( diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index c58ba28..e684bb0 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -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) #============================#