X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Writers%2Fbkmk_wflad.py;h=a848e6c6a34093c64ba127440e39ec6ad00cfefa;hb=8f5938d49646af6374afce2e6cbdfdaeb24ca65e;hp=0a94fd8e93652d9727ddc270dcaf787093fad591;hpb=61f4f37267b4f5d200abc5e8cc278d8e946cff26;p=bookmarks_db.git diff --git a/Writers/bkmk_wflad.py b/Writers/bkmk_wflad.py index 0a94fd8..a848e6c 100644 --- a/Writers/bkmk_wflad.py +++ b/Writers/bkmk_wflad.py @@ -1,17 +1,30 @@ -""" - Dump bookmarks db to a more readable FLat Ascii Database +"""Dump bookmarks db to a more readable FLat Ascii Database - Written by Broytman. Copyright (C) 2000-2010 PhiloSoft Design. +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 " +__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**9: + 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 @@ -23,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 @@ -31,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("""