X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=XHTMLWriter.py;h=caa01f3ae5067739aa61e7397477e88b3beaadf3;hb=78c968010311958e053c47617e915c37f68a7690;hp=93aa9de9a8855d803a37e83ae17aca2fc073218d;hpb=dc7db379d1b11f9de8894865689f1c626d62a523;p=planet-ucc.git diff --git a/XHTMLWriter.py b/XHTMLWriter.py index 93aa9de..caa01f3 100644 --- a/XHTMLWriter.py +++ b/XHTMLWriter.py @@ -24,9 +24,11 @@ class XHTMLWriter: output += '%s\n' % (item.imageLink, item.imageURL, item.blogName) output += '(%s)\n' % (item.itemURL ,time.strftime('posted on %A %B %d, %Y at %H:%M AWST', time.localtime(item.itemDate))) output += '

\n' - output += '

\n' + output += '

\n' output += item.contents - output += '\n

\n' + output += '\n
\n' + if item.commentsURL: + output += '

Comments

' % item.commentsURL output += '\n' return output @@ -40,6 +42,9 @@ class XHTMLWriter: output += 'Planet UCC\n' output += '\n' output += '\n' + output += '\n' + output += '\n' + output += '\n' output += '\n' output += '\n' output += '
\n' @@ -48,6 +53,19 @@ class XHTMLWriter: except: pass output += '
\n' + output += '
\n' + for date in self.planet: + output += '

%s

\n' % time.strftime('%A %B %d, %Y', time.localtime(date.planetDate)) + for item in date.items: + output += self.__write_item__(item) + # see how many items we've written + itemcount += 1 + if itemcount >= self.maxitems: + break + # again, check to see if we've written the maximum number of items + if itemcount >= self.maxitems: + break + output += '
\n' output += '\n' - output += '
\n' - for date in self.planet: - output += '

%s

\n' % time.strftime('%A %B %d, %Y', time.localtime(date.planetDate)) - for item in date.items: - output += self.__write_item__(item) - # see how many items we've written - itemcount += 1 - if itemcount >= self.maxitems: - break - # again, check to see if we've written the maximum number of items - if itemcount >= self.maxitems: - break - output += '
\n' output += '