]> git.phdru.name Git - bookmarks_db.git/blobdiff - Writers/bkmk_wflad.py
Style: Fix flake8 E501 line too long
[bookmarks_db.git] / Writers / bkmk_wflad.py
index 06c523b33034680c97b800c873443ebc7df04e4d..0d1acbb96d1d896e49ef6e5e4fbca1924f5e15b1 100644 (file)
@@ -4,7 +4,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"
 
 __all__ = ['writer_flad']
@@ -17,7 +17,7 @@ from bkmk_objects import Writer
 def strftime(s):
     try:
         return time.strftime("%a %d %b %Y %T", time.localtime(int(s)))
-    except (TypeError, ValueError): # s is None or is already formatted
+    except (TypeError, ValueError):  # s is None or is already formatted
         return s
 
 
@@ -35,7 +35,10 @@ Folder: %s
 AddDate: %s
 Comment: %s
 LastModified: %s
-""" % (level, f.name, strftime(f.add_date), f.comment, strftime(f.last_modified)))
+""" % (
+            level, f.name, strftime(f.add_date), f.comment,
+            strftime(f.last_modified))
+        )
 
     def bookmark(self, b, level):
         self.outfile.write("""
@@ -46,12 +49,18 @@ AddDate: %s
 LastVisit: %s
 LastModified: %s
 Keyword: %s
-Comment: %s""" % (level+1, b.name, b.href, strftime(b.add_date), strftime(b.last_visit), strftime(b.last_modified), b.keyword, b.comment))
-
-        for attr_name, attr_out in (("error", "Error"), ("no_error", "NoError"),
-              ("moved", "Moved"), ("size", "Size"), ("md5", "Md5"),
-              ("real_title", "RealTitle"), ("test_time", "TestTime"),
-              ("icon_href", "IconURI"), ("icon", "Icon"), ("charset", "Charset")):
+Comment: %s""" % (
+            level+1, b.name, b.href, strftime(b.add_date),
+            strftime(b.last_visit), strftime(b.last_modified),
+            b.keyword, b.comment)
+        )
+
+        for attr_name, attr_out in (
+            ("error", "Error"), ("no_error", "NoError"),
+            ("moved", "Moved"), ("size", "Size"), ("md5", "Md5"),
+            ("real_title", "RealTitle"), ("test_time", "TestTime"),
+            ("icon_href", "IconURI"), ("icon", "Icon"), ("charset", "Charset"),
+        ):
             if hasattr(b, attr_name):
                 value = getattr(b, attr_name)
                 if isinstance(value, unicode):
@@ -59,7 +68,7 @@ Comment: %s""" % (level+1, b.name, b.href, strftime(b.add_date), strftime(b.last
                 self.outfile.write("\n%s: %s" % (attr_out, value))
 
         if hasattr(b, "last_tested"):
-            self.outfile.write("\n%s: %s" % ("LastTested", strftime(getattr(b, "last_tested"))))
+            self.outfile.write("\nLastTested: %s" % strftime(b.last_tested))
 
         self.outfile.write("\n")