From: Holger Schurig Date: Wed, 23 Jun 2010 09:01:32 +0000 (+0200) Subject: rss_feed.py: generate "lastBuildDate" in GMT, not local time X-Git-Url: https://oss.titaniummirror.com/gitweb?p=webber.git;a=commitdiff_plain;h=b15ac55039fe31a3e24e9ab4652c08486cd51dd5 rss_feed.py: generate "lastBuildDate" in GMT, not local time --- diff --git a/plugins/rss_feed.py b/plugins/rss_feed.py index 9062767..79fdae9 100644 --- a/plugins/rss_feed.py +++ b/plugins/rss_feed.py @@ -17,8 +17,8 @@ def checkconfig(params): cfg.rss_file = "feed.rss" +# Helper class needed for datetime.datetime to generate GMT timestamps ZERO = datetime.timedelta(0) - class UTC(datetime.tzinfo): """UTC""" @@ -57,20 +57,19 @@ def sitemap_scan(params): items.append(item) - @set_hook("finish") def finish(params): rss = PyRSS2Gen.RSS2( title = cfg.subtitle, link = "http://%s" % cfg.main_url, description = cfg.subtitle, - lastBuildDate = datetime.datetime.now(), + lastBuildDate = datetime.datetime.now(utc), items = items, ) # Step one of self-reference # (see http://feedvalidator.org/docs/warning/MissingAtomSelfLink.html) rss.rss_attrs["xmlns:atom"] = "http://www.w3.org/2005/Atom" - + try: os.makedirs(cfg.out_dir) except: