argument check newer added to check all .tyto not yet checked in all domain

This commit is contained in:
Cyrille L 2023-04-05 10:54:56 +02:00
parent cba1abbe8a
commit 9fe57dd249
4 changed files with 31 additions and 6 deletions

View File

@ -124,8 +124,8 @@ except: target = ''
# Some conditions exiting # Some conditions exiting
if action == "check" and target == "newer": #if action == "check" and target == "newer":
logs.out("11", '"%s" with "%s"'%(target, action), True) # logs.out("11", '"%s" with "%s"'%(target, action), True)
# Set action and target for binary # Set action and target for binary

View File

@ -40,7 +40,7 @@ from datetime import datetime
from time import gmtime, strftime from time import gmtime, strftime
import args, dom, logs, status, db, form, tyto, langs import args, dom, logs, status, db, form, tyto, langs
post_err = False domain_dir = post_err = False
#=========================# #=========================#
@ -82,8 +82,29 @@ def manage(target):
# but check only if article source has changed # # but check only if article source has changed #
#----------------------------------------------# #----------------------------------------------#
def check_all(option): def check_all(option):
global domain_dir
found = False found = False
if option == "newer":
os.chdir(dom.articles_d)
domain_dir = True
for root, dirs, files in os.walk(dom.articles_d[:-1]):
for file in files:
if (file.endswith('.tyto')):
uri_file = "%s/%s"%(root, file)
uri_id = tyto.get_filesum(uri_file, False)
args.target = uri_file.rsplit(dom.articles_d)[1]
db_config = "%s%s.config"%(dom.articles_db_d, uri_id)
if os.path.exists(db_config):
continue
importlib.reload(db)
check_process(args.target)
print()
return
for post_db in os.listdir(dom.articles_db_d): for post_db in os.listdir(dom.articles_db_d):
if post_db.endswith('.config'): if post_db.endswith('.config'):
# Load DB # Load DB

View File

@ -34,11 +34,15 @@
#********************************************************************** #**********************************************************************
import os import os
import args, logs, dom, form, tyto import args, logs, dom, form, tyto, check
remove = exists = post = corrupt = False remove = exists = post = corrupt = False
try: in_dir = os.getcwd() try:
# with check newer, use domain root directory
if check.domain_dir:
os.chdir(dom.articles_d)
in_dir = os.getcwd()
except: logs.out("13", '', True) except: logs.out("13", '', True)

View File

@ -205,7 +205,7 @@ def create_stats_file(file_uri):
'quotes = %d\n'%stats["sti_quotes"] + \ 'quotes = %d\n'%stats["sti_quotes"] + \
'lists = %d\n'%stats["sti_lists"] + \ 'lists = %d\n'%stats["sti_lists"] + \
'\n' + \ '\n' + \
'# Included files in article\'s contents\n' + \ '# Included files in articles\' contents\n' + \
'files = %d\n'%stats["sti_files"] + \ 'files = %d\n'%stats["sti_files"] + \
'codes = %d\n'%stats["sti_codes"] + \ 'codes = %d\n'%stats["sti_codes"] + \
'raws = %d\n'%stats["sti_raws"] 'raws = %d\n'%stats["sti_raws"]