X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=check_title.py;h=0bb10602281defb9bd127ae91f9fdf8d8ab019a0;hb=bc56d4dc2445573da5ff95d232681bf2c0f7b732;hp=c30e025d25ffd2bd89b027ad31d35a3167afc9b8;hpb=1f50f0961e4437d8306f541bce4fee0fa37301d7;p=bookmarks_db.git diff --git a/check_title.py b/check_title.py index c30e025..0bb1060 100755 --- a/check_title.py +++ b/check_title.py @@ -52,7 +52,7 @@ def run(): sys.exit(1) if log_filename: - log_file = open(log_filename, 'wt') + log_file = open(log_filename, 'wt', encoding='utf-8') from storage import storage storage = storage() @@ -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] @@ -81,12 +82,16 @@ def run(): unquoted_title = unquote_title(quote_title(object.real_title)) unquoted_name = unquote_title(object.name) if unquoted_name != unquoted_title: - report_title(object.href, 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__':