diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 85af71c..ba355a2 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -526,6 +526,16 @@ def check_content(post_bottom): post_err = True + # Check for _image:NAME from content in header + #--------------------------------------------- + for ln, line in enumerate(post_bottom): + if line.startswith('_image:'): + image_id = line.rsplit(':', 1)[1].rsplit(' ')[0] + print(article_header) + if not re.search(r'^image:\s|%s'%image_id, article_header): + tyto.exiting("10", "image: %s"%image_id, True) + + #===============================================# # Create new article's database at each check ! # #-----------------------------------------------# diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py index 2bce32d..654dfa5 100644 --- a/src/var/lib/tyto/program/tyto.py +++ b/src/var/lib/tyto/program/tyto.py @@ -449,6 +449,7 @@ def exiting(nbr, value, out): '7' : ':< Article is \033[1;31mnot valid yet\033[0;0m', '8' : ':< tags "%s" \033[1;31mnot paired\033[0;0m'%value, '9' : ':D Article has changed (wip is old)', + '10' : ':< \033[1;31mUnused "%s"\033[0;0m in article\'s header'%value, '20' : ':D Article already up-to-date on: %s'%value, '21' : ':D Article is valid and ready to wip', '255' : ':| Maybe later...'