X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Writers%2Fbkmk_wflad_err.py;h=418a3e05c001f760e9e1368bbe0634b6eb511de9;hb=71900f3630cb51580964038b78100d60e3671981;hp=dc02c23992204054b30232e28246e8f53f4e73d3;hpb=fb5c3b2b91aeeb615d6d6d890491af3fdff69556;p=bookmarks_db.git diff --git a/Writers/bkmk_wflad_err.py b/Writers/bkmk_wflad_err.py index dc02c23..418a3e0 100644 --- a/Writers/bkmk_wflad_err.py +++ b/Writers/bkmk_wflad_err.py @@ -1,41 +1,22 @@ -""" - Dump bookmarks db to a more readable FLAD after check_urls +"""Dump bookmarks db to a more readable FLAD after check_urls - Written by BroytMann, Oct 2000 - Jun 2002. Copyright (C) 2000-2002 PhiloSoft Design +This file is a part of Bookmarks database and Internet robot. """ +__author__ = "Oleg Broytman " +__copyright__ = "Copyright (C) 2000-2012 PhiloSoft Design" +__license__ = "GNU GPL" -import time -from bkmk_objects import Writer +__all__ = ['writer_flad_err'] -def strftime(s): - return time.strftime("%a %d %b %Y %T", time.localtime(int(s))) +import time +from bkmk_wflad import writer_flad -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)