2 """Convert a bkmk database to a different storage.
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) 2000-2011 PhiloSoft Design"
12 __license__ = "GNU GPL"
18 from getopt import getopt
19 optlist, args = getopt(sys.argv[1:], "s")
23 for _opt, _arg in optlist:
32 sys.stderr.write("convert_st: too many or too few arguments\n")
33 sys.stderr.write("Usage: convert_st [-s] new_storage\n")
36 from storage import storage, import_storage
39 new_storage = import_storage(args[0])
40 new_storage = new_storage()
43 sys.stdout.write("Loading %s: " % storage.filename)
46 root_folder = storage.load()
50 sys.stdout.write("Converting to %s: " % new_storage.filename)
53 new_storage.store(root_folder)
59 if __name__ == '__main__':