X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=XMLWriter.py;h=7f60c4e9d5385170d4dadac737ef07c43d6bd331;hb=82aa14dc6dfc6cfb8449d8d0d4ea18ae1a51cadb;hp=267789cae189dc81c611648fc62d8efcd646382c;hpb=b9d9d352f6a748d1c35696e7eec7de8bbb724556;p=planet-ucc.git diff --git a/XMLWriter.py b/XMLWriter.py index 267789c..7f60c4e 100644 --- a/XMLWriter.py +++ b/XMLWriter.py @@ -71,57 +71,15 @@ class Planet: class XMLWriter: - def __init__(self, doctype, bloglist): + def __init__(self, bloglist): + self.blogs = bloglist self.planet = Planet(bloglist) self.items = self.planet.sort() - # doctype should be something like XMLWriter.XHTMLWriter - self.writer = doctype(self.items) - def write(self): - output = self.writer.write() + def write(self, doctype): + # doctype should be something like XHTMLWriter.XHTMLWriter + writer = doctype(self.items) + writer.parent = self + output = writer.write() return output -class XHTMLWriter: - def __init__(self, planet): - self.planet = planet - self.maxitems = 100 - - def __write_item__(self, item): - output = '' - output += '
\n' - output += '(%s)\n' % time.strftime('%A %B %d, %Y %H:%M %Z', time.localtime(item.itemDate)) - output += '
\n' - output += '\n' - output += item.contents - output += '\n
\n' - return output - - def write(self): - itemcount = 0 - output = '' - output += '\n' - output += '\n' - output += '\n' - output += '\n' - output += '