From 4d604acb916ee22d776fe1f4a6841d268616a4af Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Mon, 6 Feb 2023 11:41:08 +0100 Subject: [PATCH] indev publish. fix link src image HTML --- src/var/lib/tyto/program/publish.py | 17 ++++++++++++++++- src/var/lib/tyto/program/wip.py | 11 ++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/var/lib/tyto/program/publish.py b/src/var/lib/tyto/program/publish.py index d3abf50..a95b0eb 100644 --- a/src/var/lib/tyto/program/publish.py +++ b/src/var/lib/tyto/program/publish.py @@ -17,8 +17,23 @@ #********************************************************************** +import db, logs, tyto + +err_pub = True # Default (do not publish) + +#==============================# +# Manage action, get post db # +# check if publish can be done # +#------------------------------# def manage_publish(target, option): - print('> In manage_publish: t="%s", o="%s"'%(target, option)) + db_exists = tyto.get_db_post(target) + + # Checking if article can be publish + if not db_exists: logs.out("25", tyto.uri_file, False) + elif not tyto.hash_chk: logs.out("25", tyto.uri_file, False) + elif not tyto.hash_wip: logs.out("30", tyto.uri_file, False) + + if err_pub: logs.out("7", '', True) def replace_line_pub(): diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index 03d4358..1ac0423 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -295,8 +295,11 @@ def wip_images(): for value in values: if 't=' in value: target = value.rsplit('=',1)[1] - if target == "+": image_target = eval(image)[1] - else: image_target = target + if target == "+": + image_target = eval(image)[1] + image_target = sub_uri + image_target[1:] + else: + image_target = target if 'c=' in value: set_css = value.rsplit('=', 1)[1] @@ -317,8 +320,10 @@ def wip_images(): style = '' # set from parameter + image_target = eval(image)[1] + image_target = sub_uri + image_target[1:] image_src = image_show%( - set_css, eval(image)[1], eval(image)[2], style + set_css, image_target, eval(image)[2], style ) # Set link for image