X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=set-real_title.py;h=00292217f52cb0de125aa2ec822992c2ea297cc9;hb=b65d59b866ec851da9871afe9707f6b1e38866be;hp=f216b1f376ba5d7a2ab3eb7d20565a17e302cf7b;hpb=9edef5a570ea28f7c06d8d92fdd70afe0ea86809;p=bookmarks_db.git diff --git a/set-real_title.py b/set-real_title.py index f216b1f..0029221 100755 --- a/set-real_title.py +++ b/set-real_title.py @@ -1,14 +1,18 @@ #! /usr/bin/env python -""" - Run through the bookmarks database and set name to real title +"""Run through the bookmarks database and set name to real title - Written by BroytMann, Jul 2002 - May 2003. Copyright (C) 2002-2003 PhiloSoft Design +This file is a part of Bookmarks database and Internet robot. """ - +from __future__ import print_function import sys +__author__ = "Oleg Broytman " +__copyright__ = "Copyright (C) 2002-2017 PhiloSoft Design" +__license__ = "GNU GPL" + + def run(): from getopt import getopt optlist, args = getopt(sys.argv[1:], "s") @@ -24,7 +28,7 @@ def run(): pass if report_stats: - print "BroytMann set-real_title, Copyright (C) 2003 PhiloSoft Design" + print("Broytman set-real_title, Copyright (C) 2003-2017 PhiloSoft Design") if args: sys.stderr.write("set-real_title: too many arguments\n") @@ -44,7 +48,7 @@ def run(): objects = len(root_folder.linear) if report_stats: - print "Ok" + print("Ok") changed = 0 @@ -58,7 +62,7 @@ def run(): real_title = object.real_title if not real_title: real_title = object.href - if object.name <> real_title: + if object.name != real_title: object.name = real_title changed += 1 @@ -75,9 +79,9 @@ def run(): storage.store(root_folder) if changed and report_stats: - print "Ok" - print objects, "objects passed" - print changed, "objects changed" + print("Ok") + print(objects, "objects passed") + print(changed, "objects changed") if __name__ == '__main__':