From c2c1a4c8e1441a62abb3f4168a1e44596762757a Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Thu, 6 Apr 2023 15:59:19 +0200 Subject: [PATCH] Fixes : line number mismatch with icode check. + wip_images() --- src/var/lib/tyto/program/check.py | 2 +- src/var/lib/tyto/program/wip.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 7bc940a..31884c8 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -372,7 +372,7 @@ def if_icodes_bcodes_quotes(post_bottom): icode_m2 = line.count(tyto.words_tags[9][1]) if icode_m1 != icode_m2: logs.out("8", 'L=%s. icode "%s" + "%s" > %s'%( - ln + ln_header, + ln + 1 + ln_header, tyto.words_tags[9][0], tyto.words_tags[9][1], db.uri_file ), False diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index dc734e1..98581cb 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -65,8 +65,11 @@ def manage(target): 'stats' : stats.manage } - do[target]('wip') - return + try: + do[target]('wip') + return + except: + logs.out("28", '%s + %s'%(args.action, target), True) # Per article with target @@ -396,8 +399,14 @@ def get_wh_image(value): def wip_images(): if db.uniq_images == 0: return - image_link = '%s' - image_show = '%s' + image_link = \ + '%s' + image_show = \ + '%s' # Check each line for ln, line in enumerate(post_bottom.rsplit('\n')): @@ -461,7 +470,7 @@ def wip_images(): # Set HTML to replace line number image_html = image_tgt%image_src - replace_in_post(post_bottom.rsplit('\n')[ln], + replace_in_post(line, image_html )