From 57c3212f5e240dae56c9f9b268ecb1220e4de698 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 14 Nov 2023 21:01:59 +0300 Subject: [PATCH] Feat: Improve stats --- check_redirects.py | 3 +++ check_title.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/check_redirects.py b/check_redirects.py index c9161d9..ef7a505 100755 --- a/check_redirects.py +++ b/check_redirects.py @@ -64,6 +64,7 @@ def run(): if report_stats: print("Ok") + redirects = 0 for object_no in range(objects): object = root_folder.linear[object_no] @@ -75,9 +76,11 @@ def run(): if hasattr(object, "moved"): report_redirect(object.href, object.moved) del object.moved + redirects += 1 if report_stats: print(objects, "objects passed") + print(redirects, "redirects") if __name__ == '__main__': diff --git a/check_title.py b/check_title.py index 391f5a1..0bb1060 100755 --- a/check_title.py +++ b/check_title.py @@ -68,6 +68,7 @@ def run(): if report_stats: print("Ok") + changed_titles = no_titles = 0 for object_no in range(objects): object = root_folder.linear[object_no] @@ -82,11 +83,15 @@ def run(): unquoted_name = unquote_title(object.name) if unquoted_name != unquoted_title: report_title(object.href, unquoted_name, unquoted_title) + changed_titles += 1 else: report_title(object.href, object.name, None) + no_titles += 1 if report_stats: print(objects, "objects passed") + print(changed_titles, "changed titles") + print(no_titles, "no titles") if __name__ == '__main__': -- 2.39.2