From b15ac55039fe31a3e24e9ab4652c08486cd51dd5 Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Wed, 23 Jun 2010 11:01:32 +0200 Subject: [PATCH] rss_feed.py: generate "lastBuildDate" in GMT, not local time --- plugins/rss_feed.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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: -- 2.39.2