Time fix in XMLParse2
[planet-ucc.git] / XMLWriter.py
index 5b0582e..4f13913 100644 (file)
@@ -60,8 +60,8 @@ class Planet:
                                if lastItem == None:
                                        break
                                # this checks to see if it's a new day
-                               if time.gmtime(lastItem.itemDate)[6] != lastDate:
-                                       lastDate        = time.gmtime(lastItem.itemDate)[6]
+                               if time.localtime(lastItem.itemDate)[6] != lastDate:
+                                       lastDate        = time.localtime(lastItem.itemDate)[6]
                                        workingDate     = PlanetDate(lastItem.itemDate)
                                        self.dates.append(workingDate)
                                # append the item to the current date
@@ -96,7 +96,7 @@ class XHTMLWriter:
                output  +=      '<p class="time">\n'
                if item.imageURL:
                        output += '<a class="image" href="%s"><img class="image" src="%s" alt="%s" /></a>\n' % (item.imageLink, item.imageURL, item.blogTitle)
-               output  +=      '(<a href="%s">%s</a>)\n' % (item.itemURL ,time.strftime('%A %B %d, %Y %H:%M UTC', time.gmtime(item.itemDate)))
+               output  +=      '(<a href="%s">%s</a>)\n' % (item.itemURL ,time.strftime('%A %B %d, %Y %H:%M AWST', time.localtime(item.itemDate)))
                output  +=      '</p>\n'
                output  +=      '<p class="body">\n'
                output  +=      item.contents
@@ -129,18 +129,18 @@ class XHTMLWriter:
                        pass
                output  +=      '<h2>Last Updated</h2>\n'
                output  +=      '<p>\n'
-               output  +=      '%s\n' % time.strftime('%A %B %d, %Y %H:%M UTC', time.gmtime())
+               output  +=      '%s\n' % time.strftime('%A %B %d, %Y %H:%M AWST', time.localtime())
                output  +=      '</p>\n'
                if self.parent:
                        output  +=      '<h2>Feeds</h2>\n'
                        output  +=      '<p>\n'
                        for blog in self.parent.blogs:
-                               output  += '<a href="%s">%s</a><br />\n' % (blog.blogURL, blog.blogTitle)
+                               output  += '<a href="%s">%s</a> (<a href="%s">feed</a>)<br />\n' % (blog.blogURL, blog.blogTitle, blog.feedURL)
                        output  +=      '</p>\n'
                output  +=      '</div>\n'
                output  +=      '<div class="items">\n'
                for date in self.planet:
-                       output  += '<h1>%s</h1>\n' % time.strftime('%A %B %d, %Y', time.gmtime(date.planetDate))
+                       output  += '<h1>%s</h1>\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

UCC git Repository :: git.ucc.asn.au