X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=db2bkmk.py;h=7d1d9aa19f1c46fdebd47e45f859ab7a7c7e2ba7;hb=a23c3efc90dd6a038d11f5892510a93e09593a70;hp=7d9ab2cd6e8a65b0989f5828b3c4299f662307c7;hpb=cb9c36b39ed72cd1fa272130d2bcf162a89c3013;p=bookmarks_db.git diff --git a/db2bkmk.py b/db2bkmk.py index 7d9ab2c..7d1d9aa 100755 --- a/db2bkmk.py +++ b/db2bkmk.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 """Convert a bkmk database back to bookmarks.html (or other format defined by writer) @@ -63,7 +63,6 @@ def run(): sys.stdout.flush() if transl: - new_ext = str(transl) transl_d = {} from m_lib.flad import fladm @@ -93,12 +92,12 @@ def run(): href = b.href transl_d = self.transl_d - if transl_d.has_key(href): + if href in transl_d: b.href = transl_d[href] root_folder.walk_depth(Transl(transl_d)) - outfile = open(output_filename, 'w') + outfile = open(output_filename, 'wt', encoding='utf-8') root_folder.walk_depth(writer(outfile, prune)) outfile.close()