]> err.no Git - dak/commitdiff
use different pubDate if going in or out
authorFilippo Giunchedi <filippo@esaurito.net>
Tue, 9 Dec 2008 22:16:30 +0000 (23:16 +0100)
committerFilippo Giunchedi <filippo@esaurito.net>
Tue, 9 Dec 2008 22:24:16 +0000 (23:24 +0100)
queue_rss.py

index c312b25b64d9c67c438ab000c5a9a887df2aa3ff..c99bd6cc506e609a4a84b161f4195876cb83faee 100755 (executable)
@@ -12,6 +12,7 @@ import sys
 import encodings.ascii
 from email.Parser import HeaderParser
 from optparse import OptionParser
+from datetime import datetime
 
 import PyRSS2Gen
 
@@ -101,9 +102,11 @@ def add_rss_item(status, msg, direction):
     if direction == "in":
         feed = status.feed_in
         title = "%s %s entered NEW" % (msg['Source'], msg['Version'])
+        pubdate = msg['Date']
     elif direction == "out":
         feed = status.feed_out
         title = "%s %s left NEW" % (msg['Source'], msg['Version'])
+        pubdate = datetime.utcnow()
     else:
         return False
 
@@ -113,8 +116,7 @@ def add_rss_item(status, msg, direction):
     feed.items.insert(0,
         PyRSS2Gen.RSSItem(
             title,
-            pubDate = msg['Date'],
-#            pubDate = now(),
+            pubDate = pubdate,
             description = description,
             author = utf2ascii(msg['Maintainer']),
             link = "http://ftp-master.debian.org/new/%s_%s.html" % \