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