X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=db2bkmk.py;h=897aabcafa922ee64a7c22f3aa92571d544c9a6d;hb=b2b302b348f0b711557961c70744c818cff664f0;hp=78618e712709404234e4b461c1a25a4866899023;hpb=d5365dbb38d672f256a5e7a2f949c789bc5793ce;p=bookmarks_db.git diff --git a/db2bkmk.py b/db2bkmk.py index 78618e7..897aabc 100755 --- a/db2bkmk.py +++ b/db2bkmk.py @@ -22,7 +22,7 @@ def run(): output_filename = writer.filename transl = 0 - transl_name = "" # dictionary translation; default is no translation + transl_name = "" # dictionary translation; default is no translation for _opt, _arg in optlist: if _opt == '-s': @@ -60,7 +60,6 @@ def run(): sys.stdout.write("Writing %s: " % output_filename) sys.stdout.flush() - if transl: new_ext = str(transl) transl_d = {} @@ -79,11 +78,12 @@ def run(): else: raise ValueError("transl (%d) must be 1 or 2" % transl) - del transl_db # Save few bytes of memory + del transl_db # Save few bytes of memory from bkmk_objects import Walker + class Transl(Walker): - def __init__(self, transl_d): + def __init__(self, transl_d): # noqa: E306 expected 1 blank line self.transl_d = transl_d def bookmark(self, b, level): @@ -95,7 +95,6 @@ def run(): root_folder.walk_depth(Transl(transl_d)) - outfile = open(output_filename, 'w') root_folder.walk_depth(writer(outfile, prune)) outfile.close()