X-Git-Url: https://git.ucc.asn.au/?p=planet-ucc.git;a=blobdiff_plain;f=XMLWriter.py;h=38904dcf3874d6e216ac760d3387d068af81dd29;hp=80270b29cafbfe5b3d209224a286bbc8c52c8eca;hb=1640afe2184955716ac426b42355a3a6198d4d17;hpb=ff671f12215752898909c43c32f8ffa059845eb2 diff --git a/XMLWriter.py b/XMLWriter.py index 80270b2..38904dc 100644 --- a/XMLWriter.py +++ b/XMLWriter.py @@ -96,7 +96,7 @@ class XHTMLWriter: output += '

\n' if item.imageURL: output += '%s\n' % (item.imageLink, item.imageURL, item.blogTitle) - output += '(%s)\n' % (item.itemURL ,time.strftime('%A %B %d, %Y %H:%M %Z', time.localtime(item.itemDate))) + output += '(%s)\n' % (item.itemURL ,time.strftime('%A %B %d, %Y %H:%M AWST', time.localtime(item.itemDate))) output += '

\n' output += '

\n' output += item.contents @@ -129,13 +129,15 @@ class XHTMLWriter: pass output += '

Last Updated

\n' output += '

\n' - output += '%s\n' % time.strftime('%A %B %d, %Y %H:%M', time.localtime()) + output += '%s\n' % time.strftime('%A %B %d, %Y %H:%M AWST', time.localtime()) output += '

\n' if self.parent: output += '

Feeds

\n' output += '

\n' - for blog in self.parent.blogs: - output += '%s
\n' % (blog.blogURL, blog.blogTitle) + blogscopy = self.parent.blogs + [] + blogscopy.sort(self.__blog_sort__) + for blog in blogscopy: + output += '%s (feed)
\n' % (blog.blogURL, blog.blogTitle, blog.feedURL) output += '

\n' output += '\n' output += '
\n' @@ -160,3 +162,9 @@ class XHTMLWriter: output += '\n' output += '' return output + + def __blog_sort__(self, blog1, blog2): + name1, name2 = blog1.blogTitle.split(' ')[-1], blog2.blogTitle.split(' ')[-1] + if name1 < name2: return -1 + if name1 == name2: return 0 + if name1 > name2: return 1