From: Oleg Broytman Date: Tue, 14 Nov 2023 18:01:59 +0000 (+0300) Subject: Feat: Improve stats X-Git-Tag: 5.0.0~31 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=57c3212f5e240dae56c9f9b268ecb1220e4de698;p=bookmarks_db.git Feat: Improve stats --- 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__':