X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=XMLWriter.py;h=7f60c4e9d5385170d4dadac737ef07c43d6bd331;hb=7c1189be656d2ab9f484d9d0f1ab1b8f287de4c8;hp=6f39119e01a3a0caa8690e6d1664af9922502e55;hpb=18f48e511713b1d2d168585d656ebfe5f7c0f2ea;p=planet-ucc.git diff --git a/XMLWriter.py b/XMLWriter.py index 6f39119..7f60c4e 100644 --- a/XMLWriter.py +++ b/XMLWriter.py @@ -71,92 +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) - self.writer.parent = self - 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 = 50 - self.parent = None - - def __write_item__(self, item): - output = '' - output += '
\n'
- if item.imageURL:
- output += '\n' % (item.imageLink, item.imageURL, item.blogTitle)
- output += '(%s)\n' % (item.itemURL ,time.strftime('%A %B %d, %Y %H:%M AWST', time.localtime(item.itemDate)))
- output += '
\n' - output += item.contents - output += '\n
\n' - output += '