]> git.phdru.name Git - bookmarks_db.git/blobdiff - Writers/bkmk_wflad.py
2039!
[bookmarks_db.git] / Writers / bkmk_wflad.py
index d5cb7e01d8645dd9bc50c77f01a152c5ee9a663b..a82c52ca586244e7024bc18ede089afb775d5ab8 100644 (file)
@@ -10,13 +10,21 @@ __author__ = "Oleg Broytman <phd@phdru.name>"
 __copyright__ = "Copyright (C) 2000-2011 PhiloSoft Design"
 __license__ = "GNU GPL"
 
+__all__ = ['writer_flad']
+
+
 import time
 from bkmk_objects import Writer
 
 
 def strftime(s):
+   if s is None:
+      return s
+   n = int(s)
+   if n > 10**10:
+      n /= 10**6
    try:
-      return time.strftime("%a %d %b %Y %T", time.localtime(int(s)))
+      return time.strftime("%a %d %b %Y %T", time.localtime(n))
    except (TypeError, ValueError): # s is None or is already formatted
       return s
 
@@ -28,7 +36,6 @@ class writer_flad(Writer):
       Writer.__init__(self, outfile, prune)
       self.first_object = 1
 
-
    def start_folder(self, f, level):
       self.outfile.write("""
 Level: %d
@@ -36,8 +43,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("""