check + wip: fix db + replace post_wip to db

This commit is contained in:
Cyrille L 2022-11-25 18:57:38 +01:00
parent 9b24821e47
commit 442d4c6c44
2 changed files with 12 additions and 5 deletions

View File

@ -1224,9 +1224,9 @@ def create_DB(post_db):
'post_tmp = "%s"'%post_tmp, 'post_tmp = "%s"'%post_tmp,
'post_url = "%s"'%post_url, 'post_url = "%s"'%post_url,
'\n# Article Status', '\n# Article Status',
'post_chk = ("%s","%s")'%(hash_chk,time_chk), 'post_chk = (\'%s\', \'%s\')'%(hash_chk,time_chk),
'post_wip = ("%s","%s")'%(hash_wip,time_wip), 'post_wip = (\'%s\', \'%s\')'%(hash_wip,time_wip),
'post_www = ("%s","%s")'%(hash_www,time_www), 'post_www = (\'%s\', \'%s\')'%(hash_www,time_www),
'\n# Mandatory Headers', '\n# Mandatory Headers',
'post_title = "%s"'%title[2], 'post_title = "%s"'%title[2],
'post_about = "%s"'%about[2], 'post_about = "%s"'%about[2],

View File

@ -133,11 +133,18 @@ def manage_wip(file_post, Force):
time_wip = log.nowdate() time_wip = log.nowdate()
hash_wip = check.get_filesum(post_uri, True) hash_wip = check.get_filesum(post_uri, True)
rep_post_wip = 'post_wip = %s'%str(check.post_wip) rep_post_wip = 'post_wip = (\'%s\', \'%s\')'%(
tmp_post_wip = ('"%s"'%hash_wip, '"%s"'%time_wip) check.post_wip[0], check.post_wip[1])
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) 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 # # HTML CONVERTERS #