X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=convert_st.py;h=4c0cb15d206968c4045d78cd930ad9fc4a03c437;hb=ffdaa8835ae34cd5b9c712d962a5830e0edeed05;hp=89bd8ab2f72cbc61aa41467ee045ae4e49b1158f;hpb=71712390f4edb041609ff7bc9272d12a5c1a9b1d;p=bookmarks_db.git diff --git a/convert_st.py b/convert_st.py index 89bd8ab..4c0cb15 100755 --- a/convert_st.py +++ b/convert_st.py @@ -5,7 +5,7 @@ This file is a part of Bookmarks database and Internet robot. """ __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2000-2012 PhiloSoft Design" +__copyright__ = "Copyright (C) 2000-2017 PhiloSoft Design" __license__ = "GNU GPL" import sys @@ -25,15 +25,19 @@ def run(): except NameError: pass - if len(args) <> 1: + if len(args) != 1: sys.stderr.write("convert_st: too many or too few arguments\n") 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: @@ -43,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__':