X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=convert_st.py;h=005710b8067d558fff6f20953640d21014404a4e;hb=97202bf84e9c78d8fac912a82a85fb1cbb233a4b;hp=15bc7aadac043153b5e66fa8a824b505878b65cd;hpb=0e76f1851882b99da63a7c8a9e4cdf0c4a48657f;p=bookmarks_db.git diff --git a/convert_st.py b/convert_st.py index 15bc7aa..005710b 100755 --- a/convert_st.py +++ b/convert_st.py @@ -1,10 +1,12 @@ #! /usr/bin/env python -""" - Convert a bkmk database to a different storage. +"""Convert a bkmk database to a different storage. - Written by Broytman, Apr 2000 - Aug 2002. Copyright (C) 2000-2002 PhiloSoft Design +This file is a part of Bookmarks database and Internet robot. """ +__author__ = "Oleg Broytman " +__copyright__ = "Copyright (C) 2000-2017 PhiloSoft Design" +__license__ = "GNU GPL" import sys @@ -28,10 +30,14 @@ def run(): sys.stderr.write("Usage: convert_st [-s] new_storage\n") sys.exit(1) + from bkmk_objects import parse_params, set_params from storage import storage, import_storage + storage = storage() - new_storage = import_storage(args[0]) + storage_name, storage_params = parse_params(args[0]) + new_storage = import_storage(storage_name) + set_params(new_storage, storage_params) new_storage = new_storage() if report_stats: @@ -41,14 +47,14 @@ def run(): root_folder = storage.load() if report_stats: - print "Ok" + print("Ok") sys.stdout.write("Converting to %s: " % new_storage.filename) sys.stdout.flush() new_storage.store(root_folder) if report_stats: - print "Ok" + print("Ok") if __name__ == '__main__':