2 """Check and show URLs in the bookmarks database where name != real title
4 This file is a part of Bookmarks database and Internet robot.
7 __version__ = "$Revision$"[11:-2]
8 __revision__ = "$Id$"[5:-2]
9 __date__ = "$Date$"[7:-2]
10 __author__ = "Oleg Broytman <phd@phdru.name>"
11 __copyright__ = "Copyright (C) 2002-2011 PhiloSoft Design"
12 __license__ = "GNU GPL"
15 from bkmk_objects import make_linear, quote_title, unquote_title
19 from getopt import getopt
20 optlist, args = getopt(sys.argv[1:], "s")
24 for _opt, _arg in optlist:
33 print "Broytman check_title, Copyright (C) 2002-2010 PhiloSoft Design"
36 sys.stderr.write("check_title: too many arguments\n")
37 sys.stderr.write("Usage: check_title [-s]\n")
40 from storage import storage
44 sys.stdout.write("Loading %s: " % storage.filename)
47 root_folder = storage.load()
48 make_linear(root_folder)
49 objects = len(root_folder.linear)
55 for object_no in range(objects):
56 object = root_folder.linear[object_no]
59 if hasattr(object, "moved") or hasattr(object, "error") \
60 or object.href.startswith('place:'): # Firefox SmartBookmarks
63 if hasattr(object, "real_title") and (object.real_title is not None):
64 unquoted_title = unquote_title(quote_title(object.real_title))
65 unquoted_name = unquote_title(object.name)
66 if unquoted_name <> unquoted_title:
74 print "NO REAL TITLE!!!"
79 print objects, "objects passed"
82 if __name__ == '__main__':