From: Oleg Broytman Date: Wed, 4 Aug 2004 13:06:51 +0000 (+0000) Subject: Used writer_flad as the base class. X-Git-Tag: v4.5.3~344 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=5fe08492a0172cb8fb53b8cf3515540def24d76f;p=bookmarks_db.git Used writer_flad as the base class. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@32 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Writers/bkmk_wflad_err.py b/Writers/bkmk_wflad_err.py index dc02c23..a0a586a 100644 --- a/Writers/bkmk_wflad_err.py +++ b/Writers/bkmk_wflad_err.py @@ -1,41 +1,21 @@ """ Dump bookmarks db to a more readable FLAD after check_urls - Written by BroytMann, Oct 2000 - Jun 2002. Copyright (C) 2000-2002 PhiloSoft Design + Written by BroytMann, Oct 2000 - Aug 2004. Copyright (C) 2000-2004 PhiloSoft Design """ import time -from bkmk_objects import Writer +from bkmk_wflad import writer_flad def strftime(s): return time.strftime("%a %d %b %Y %T", time.localtime(int(s))) -class writer_flad_err(Writer): +class writer_flad_err(writer_flad): filename = "bookmarks_db.errors" def bookmark(self, b, level): - if not hasattr(b, "error"): - return - - self.outfile.write(""" -Level: %d -Title: %s -URL: %s -AddDate: %s -LastVisit: %s -LastModified: %s -Comment: %s""" % (1, b.name, b.href, strftime(b.add_date), strftime(b.last_visit), strftime(b.last_modified), 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")): - if hasattr(b, attr_name): - self.outfile.write("\n%s: %s" % (attr_out, getattr(b, attr_name))) - - if hasattr(b, "last_tested"): - self.outfile.write("\n%s: %s" % ("LastTested", strftime(getattr(b, "last_tested")))) - - self.outfile.write("\n") + if hasattr(b, "error"): + writer_flad.bookmark(self, b, level)