stats for statoolinfos: generated on demand with "wip stats". Todo: "publish stats"

This commit is contained in:
Cyrille L 2023-03-11 11:51:23 +01:00
parent 6a06c07419
commit 57b401da70
1 changed files with 32 additions and 6 deletions

View File

@ -22,7 +22,7 @@ import args, logs, db, domain, tyto
sti_anchors = sti_abbrs = sti_links = 0
sti_images = sti_files = sti_raws = 0
sti_tags = sti_words = sti_titles = sti_paragraphs = sti_anclink = 0
sti_tags = sti_words = sti_titles = sti_paragraphs = sti_anclinks = 0
sti_strongs = sti_bolds = sti_emphasis = sti_italics = sti_dels = 0
sti_underlines = sti_cites = sti_customs = sti_icodes = 0
sti_bcodes = sti_quotes = sti_lists = sti_articles = 0
@ -97,7 +97,7 @@ def count_stats():
# Set Statistics
global sti_anchors, sti_abbrs, sti_links
global sti_images, sti_files, sti_raws
global sti_tags, sti_words, sti_titles, sti_paragraphs, sti_anclink
global sti_tags, sti_words, sti_titles, sti_paragraphs, sti_anclinks
global sti_strongs, sti_bolds, sti_emphasis, sti_italics, sti_dels
global sti_underlines, sti_cites, sti_customs, sti_icodes
global sti_bcodes, sti_quotes, sti_lists
@ -113,12 +113,12 @@ def count_stats():
sti_words = sti_words + db.stat_words
sti_titles = sti_titles + db.stat_titles
sti_paragraphs = sti_paragraphs + db.stat_paragraphs
sti_anclink = sti_anclink + db.stat_anchors
sti_anclinks = sti_anclinks + db.stat_anchors
sti_strongs = sti_strongs + db.stat_strongs
sti_bolds = sti_bolds + db.stat_bolds
sti_emphasis = sti_emphasis + db.stat_emphasis
sti_italics = sti_italics + db.stat_italics
sti_dels = sti_dels + db.stat_dels
sti_dels = sti_dels + db.stat_dels
sti_underlines = sti_underlines + db.stat_underlines
sti_cites = sti_cites + db.stat_cites
sti_customs = sti_customs + db.stat_customs
@ -135,9 +135,35 @@ def create_stats_file(file_uri):
sti = \
'# Statistics file created by %s\n'%tyto.Tyto + \
'# Website: %s\n'%domain_srv + \
'# Generated: %s\n'%tyto.nowdate() + \
'\n' + \
'stats_articles = %d\n'%int(sti_articles)
'# Uniq statistics from articles\' headers\n' + \
'stats_articles = %d\n'%int(sti_articles) + \
'stats_uniq_anchors = %d\n'%int(sti_anchors) + \
'stats_uniq_abbrs = %d\n'%int(sti_abbrs) + \
'stats_uniq_links = %d\n'%int(sti_links) + \
'stats_uniq_images = %d\n'%int(sti_images) + \
'stats_uniq_files = %d\n'%int(sti_files) + \
'stats_uniq_raws = %d\n'%int(sti_raws) + \
'\n' + \
'# Statistics from articles\' content\n' + \
'stats_tags = %d\n'%int(sti_tags) + \
'stats_words = %d\n'%int(sti_words) + \
'stats_titles = %d\n'%int(sti_titles) + \
'stats_paragraphs = %d\n'%int(sti_paragraphs) + \
'stats_link_anchors = %d\n'%int(sti_anclinks) + \
'stats_strongs = %d\n'%int(sti_strongs) + \
'stats_bolds = %d\n'%int(sti_bolds) + \
'stats_emphasis = %d\n'%int(sti_emphasis) + \
'stats_italics = %d\n'%int(sti_italics) + \
'stats_dels = %d\n'%int(sti_dels) + \
'stats_underlines = %d\n'%int(sti_underlines) + \
'stats_cites = %d\n'%int(sti_cites) + \
'stats_customs = %d\n'%int(sti_customs) + \
'stats_icodes = %d\n'%int(sti_icodes) + \
'stats_bcodes = %d\n'%int(sti_bcodes) + \
'stats_quotes = %d\n'%int(sti_quotes) + \
'stats_lists = %d\n'%int(sti_lists)
tyto.set_file(file_uri, 'New', sti)
logs.out("33", file_uri, False)