X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Writers%2Fbkmk_wflad.py;h=a4e88fcb7c9cd27d8fb9f2283cf47ca7ece4dcff;hb=1e2f258f40c74803df6746e7b6041776ba715f4b;hp=0ba70751cfa7693c26f5b965f4f2ef4dbfa9d40f;hpb=5291c9e91503d288a4a50a30345d1d33ced56f32;p=bookmarks_db.git diff --git a/Writers/bkmk_wflad.py b/Writers/bkmk_wflad.py index 0ba7075..a4e88fc 100644 --- a/Writers/bkmk_wflad.py +++ b/Writers/bkmk_wflad.py @@ -1,9 +1,17 @@ -""" - Dump bookmarks db to a more readable FLAD after check_urls +"""Dump bookmarks db to a more readable FLat Ascii Database - Written by BroytMann, Apr 2000 - Sep 2007. Copyright (C) 2000-2007 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 @@ -12,7 +20,7 @@ from bkmk_objects import Writer def strftime(s): try: return time.strftime("%a %d %b %Y %T", time.localtime(int(s))) - except ValueError: # s is already formatted + except (TypeError, ValueError): # s is None or is already formatted return s @@ -23,7 +31,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 @@ -33,7 +40,6 @@ Comment: %s LastModified: %s """ % (level, f.name, strftime(f.add_date), f.comment, f.last_modified or '')) - def bookmark(self, b, level): self.outfile.write(""" Level: %d @@ -48,7 +54,7 @@ Comment: %s""" % (level+1, b.name, b.href, strftime(b.add_date), strftime(b.last for attr_name, attr_out in (("error", "Error"), ("no_error", "NoError"), ("moved", "Moved"), ("size", "Size"), ("md5", "Md5"), ("real_title", "RealTitle"), ("test_time", "TestTime"), - ("icon", "Icon"), ("charset", "Charset")): + ("icon_href", "IconURI"), ("icon", "Icon"), ("charset", "Charset")): if hasattr(b, attr_name): self.outfile.write("\n%s: %s" % (attr_out, getattr(b, attr_name)))