Preparing check process, head tags in article
This commit is contained in:
parent
c530449369
commit
fed0227968
|
@ -49,12 +49,12 @@ def get_action():
|
|||
# Target arguments #
|
||||
#------------------#
|
||||
def get_target():
|
||||
global target, multiple
|
||||
global target, targets
|
||||
try: target = sys.argv[2]
|
||||
except: target = ""
|
||||
|
||||
multiple = False
|
||||
if target == "all": multiple = True
|
||||
targets = False
|
||||
if target == "all": targets = True
|
||||
|
||||
|
||||
#================================#
|
||||
|
|
|
@ -55,7 +55,7 @@ def ready():
|
|||
#-------------------------------------------#
|
||||
def manage(action, target):
|
||||
# target is "all"
|
||||
if args.multiple:
|
||||
if args.targets:
|
||||
multiple_targets
|
||||
return
|
||||
|
||||
|
@ -76,17 +76,27 @@ def is_article(target):
|
|||
|
||||
sys.exit(post.error)
|
||||
|
||||
head_contents()
|
||||
validators()
|
||||
if post.error != 0:
|
||||
if args.multiple:
|
||||
if args.targets:
|
||||
return # Let other articles pass
|
||||
|
||||
sys.exit(post.error)
|
||||
|
||||
print("pass", post.error, args.multiple)
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
def validators():
|
||||
targets = args.targets
|
||||
post.error == 0 and ol_tags() or tools.exit(targets, post.error)
|
||||
|
||||
|
||||
|
||||
#===========================================#
|
||||
# # Create a loop to get all .tyto articles #
|
||||
# Create a loop to get all .tyto articles #
|
||||
#-------------------------------------------#
|
||||
def multiple_targets():
|
||||
ready()
|
||||
|
@ -95,7 +105,7 @@ def multiple_targets():
|
|||
#=======================#
|
||||
# check header contents #
|
||||
#-----------------------#
|
||||
def head_contents():
|
||||
def ol_tags():
|
||||
for ln, line in enumerate(post.head_contents.rsplit("\n"), 1):
|
||||
if not line or line.isspace() or line.startswith("#"): continue
|
||||
|
||||
|
@ -157,3 +167,10 @@ def is_ol_tag(tag, value):
|
|||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
def valid_date():
|
||||
|
||||
|
|
|
@ -33,10 +33,19 @@
|
|||
#--------------------------
|
||||
|
||||
from hashlib import blake2b
|
||||
import os, configparser, datetime, time
|
||||
import sys, os, configparser, datetime, time
|
||||
import debug, domain
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
def exit(targets, error):
|
||||
if targets: return
|
||||
|
||||
sys.exit(error)
|
||||
|
||||
|
||||
#==============================#
|
||||
# Set and return date and time #
|
||||
# With local options from lang #
|
||||
|
|
Loading…
Reference in New Issue