litle misc

This commit is contained in:
Cyrille L 2022-11-21 17:13:02 +01:00
parent f4fbb825db
commit 17e3fdd342
1 changed files with 7 additions and 8 deletions

View File

@ -52,7 +52,7 @@ markers_opt = (
def post_IDs(file_post): def post_IDs(file_post):
# Check if argument's file (.tyto) or exit # Check if argument's file (.tyto) or exit
if not file_post: if not file_post:
print(':( Unused argument file') print(':< Unused argument file')
sys.exit(1) sys.exit(1)
# Set HTML file from file_post # Set HTML file from file_post
@ -62,7 +62,7 @@ def post_IDs(file_post):
global post_uri global post_uri
post_uri = '%s%s'%(domain.domain_articles, file_post) post_uri = '%s%s'%(domain.domain_articles, file_post)
if not os.path.exists(post_uri): if not os.path.exists(post_uri):
print(':( Unused file: %s'%post_uri) print(':< Unused file: %s'%post_uri)
sys.exit(1) sys.exit(1)
# From argument file_post # From argument file_post
@ -187,7 +187,7 @@ def process_article(post_uri, Force):
file.close() file.close()
msg_log = 'Log > Create logs file for %s in %s\n'%( msg_log = 'Log > Create logs file for %s in %s\n'%(
post_uri, post_logs) post_uri, post_logs)
log.append_f(post_logs,msg_log,0) log.append_f(post_logs, msg_log, 0)
# Article Database # Article Database
#------------------ #------------------
@ -204,7 +204,7 @@ def process_article(post_uri, Force):
# Compare chk Hashes. # Compare chk Hashes.
# Pass if Force, and not same # Pass if Force, and not same
if hash_chk == post_chk[0] and not Force: if hash_chk == post_chk[0] and not Force:
print(':) Check was already done, on', post_chk[1]) print(':D Check was already done, on', post_chk[1])
sys.exit(0) sys.exit(0)
# Processing # Processing
@ -220,7 +220,6 @@ def process_article(post_uri, Force):
check_post_header(headers.rsplit('\n')) check_post_header(headers.rsplit('\n'))
if Post_Err: sys.exit(1) if Post_Err: sys.exit(1)
# Protect bCodes, keep markers for stats, before checking other markers # Protect bCodes, keep markers for stats, before checking other markers
wip.convert_bcodes(article.rsplit('\n'), wip.convert_bcodes(article.rsplit('\n'),
'[[', ']]', '[[', ']]',
@ -406,13 +405,13 @@ def if_mandat_marker(marker, m_in):
if not m_in[0]: if not m_in[0]:
msg_log = 'Unused needed marker "%s"'%marker msg_log = 'Unused needed marker "%s"'%marker
log.append_f(post_logs,msg_log,1) log.append_f(post_logs, msg_log, 1)
Post_Err = True Post_Err = True
elif not m_in[2]: elif not m_in[2]:
msg_log = 'Line %s. Undefined marker "%s"'%( msg_log = 'Line %s. Undefined marker "%s"'%(
m_in[1], marker m_in[1], marker
) )
log.append_f(post_logs,msg_log,1) log.append_f(post_logs, msg_log, 1)
#================================# #================================#
# Check Date format and validity # # Check Date format and validity #