diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 4027cb3..8a7cfd3 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -419,6 +419,7 @@ def if_mandat_marker(marker, m_in): m_in[1], marker ) log.append_f(post_logs, msg_log, 1) + Post_Err = True #================================# # Check Date format and validity # @@ -499,12 +500,21 @@ def check_links(line, ln, stats_links_uniq): global Post_Err, stats_links_p # Create variable array + try: link_name = line.split('link:')[1].lstrip() + except: link_name = '' + try: link_url = headers.rsplit('\n')[ln].lstrip() + except: link_url = '' + try: link_alt = headers.rsplit('\n')[ln+1].lstrip() + except: link_alt = '' + + if not link_name: + msg_log = 'Line %s. Unused NAME for marker "link:"'%ln + log.append_f(post_logs,msg_log,1) + Post_Err = True + return(1) + link_nbr = 'link_%s'%stats_links_uniq - link_name = line.split('link:')[1].lstrip() - link_url = headers.rsplit('\n')[ln].lstrip() - link_alt = headers.rsplit('\n')[ln+1].lstrip() - - # Check 2nd line + # Check 2nd line check_new_marker(link_url) if new_marker: link_url = '' @@ -530,7 +540,6 @@ def check_links(line, ln, stats_links_uniq): log.append_f(post_logs,msg_log,1) Post_Err = True - if Post_Err: return # Set final marker_N link = (