]> git.phdru.name Git - bookmarks_db.git/blobdiff - Writers/bkmk_wflad.py
Feat(Python3): `raise Error, value` -> `raise Error(value)`
[bookmarks_db.git] / Writers / bkmk_wflad.py
index a4e88fcb7c9cd27d8fb9f2283cf47ca7ece4dcff..999872b1e488a93c062a3caa3514f0281da33439 100644 (file)
@@ -3,11 +3,8 @@
 This file is a part of Bookmarks database and Internet robot.
 """
 
-__version__ = "$Revision$"[11:-2]
-__revision__ = "$Id$"[5:-2]
-__date__ = "$Date$"[7:-2]
 __author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2000-2011 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2000-2012 PhiloSoft Design"
 __license__ = "GNU GPL"
 
 __all__ = ['writer_flad']
@@ -38,7 +35,7 @@ Folder: %s
 AddDate: %s
 Comment: %s
 LastModified: %s
-""" % (level, f.name, strftime(f.add_date), f.comment, f.last_modified or ''))
+""" % (level, f.name, strftime(f.add_date), f.comment, strftime(f.last_modified)))
 
    def bookmark(self, b, level):
       self.outfile.write("""
@@ -56,7 +53,10 @@ Comment: %s""" % (level+1, b.name, b.href, strftime(b.add_date), strftime(b.last
             ("real_title", "RealTitle"), ("test_time", "TestTime"),
             ("icon_href", "IconURI"), ("icon", "Icon"), ("charset", "Charset")):
          if hasattr(b, attr_name):
-            self.outfile.write("\n%s: %s" % (attr_out, getattr(b, attr_name)))
+            value = getattr(b, attr_name)
+            if isinstance(value, unicode):
+               value = value.encode('utf-8')
+            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"))))