From 442d4c6c444364d22ea1ac3bc1bfbcc59b0bf4fc Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Fri, 25 Nov 2022 18:57:38 +0100 Subject: [PATCH] check + wip: fix db + replace post_wip to db --- src/var/lib/tyto/program/check.py | 6 +++--- src/var/lib/tyto/program/wip.py | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index a8164c6..2783c30 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -1224,9 +1224,9 @@ def create_DB(post_db): 'post_tmp = "%s"'%post_tmp, 'post_url = "%s"'%post_url, '\n# Article Status', - 'post_chk = ("%s","%s")'%(hash_chk,time_chk), - 'post_wip = ("%s","%s")'%(hash_wip,time_wip), - 'post_www = ("%s","%s")'%(hash_www,time_www), + 'post_chk = (\'%s\', \'%s\')'%(hash_chk,time_chk), + 'post_wip = (\'%s\', \'%s\')'%(hash_wip,time_wip), + 'post_www = (\'%s\', \'%s\')'%(hash_www,time_www), '\n# Mandatory Headers', 'post_title = "%s"'%title[2], 'post_about = "%s"'%about[2], diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index cc76e05..c58ba28 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -133,11 +133,18 @@ def manage_wip(file_post, Force): time_wip = log.nowdate() hash_wip = check.get_filesum(post_uri, True) - rep_post_wip = 'post_wip = %s'%str(check.post_wip) - tmp_post_wip = ('"%s"'%hash_wip, '"%s"'%time_wip) + rep_post_wip = 'post_wip = (\'%s\', \'%s\')'%( + 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) + 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) + #============================# # HTML CONVERTERS #