]> git.phdru.name Git - bookmarks_db.git/blobdiff - db2bkmk.py
Style: Fix flake8 E402 module level import not at top of file
[bookmarks_db.git] / db2bkmk.py
index e0ac1c1bcb6b76c6247f7680421a2e66765b34a4..897aabcafa922ee64a7c22f3aa92571d544c9a6d 100755 (executable)
@@ -5,7 +5,7 @@ This file is a part of Bookmarks database and Internet robot.
 """
 
 __author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2000-2017 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2000-2023 PhiloSoft Design"
 __license__ = "GNU GPL"
 
 import sys
@@ -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,14 +60,13 @@ def run():
         sys.stdout.write("Writing %s: " % output_filename)
         sys.stdout.flush()
 
-
     if transl:
         new_ext = str(transl)
         transl_d = {}
 
         from m_lib.flad import fladm
         transl_db = fladm.load_from_file(transl_name, fladm.check_record, ["URL1", "URL2"], [""])
-                                        # This prevents any other key to appear in transl_db ^
+        #                                 This prevents any other key to appear in transl_db ^
 
         # Generate translation dictionary (hash table)
         if transl == 1:
@@ -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()