[patch] tools/queue_rss.py: Fix author format
Hi,
I've just made a little patch as attached file to fix author format on
NEW_in.rss and NEW_out.rss.
Some parser reject RSS with wrong author format.
Cheers,
PS: (I'm not subscribed to debian-dak list)
--
Laurent
>From 06347d6b3c50bc5f99282bf1bbc5dfd24ba6614c Mon Sep 17 00:00:00 2001
From: Laurent Arnoud <laurent@spkdev.net>
Date: Sat, 25 Oct 2014 17:47:13 +0200
Subject: [PATCH] tools/queue_rss.py: Fix author format
see http://validator.w3.org/feed/docs/warning/EmailFormat.html
Signed-off-by: Laurent Arnoud <laurent@spkdev.net>
---
tools/queue_rss.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/queue_rss.py b/tools/queue_rss.py
index da74a0d..fd49c0d 100755
--- a/tools/queue_rss.py
+++ b/tools/queue_rss.py
@@ -14,6 +14,7 @@ import sys
import time
from optparse import OptionParser
from datetime import datetime
+from email.utils import parseaddr
import PyRSS2Gen
@@ -141,12 +142,15 @@ def add_rss_item(status, msg, direction):
link = "https://ftp-master.debian.org/new/%s_%s.html" % \
(msg['Source'], msg['Version'])
+ maintainer = parseaddr(msg['Maintainer'])
+ author = "%s (%s)" % (maintainer[1], maintainer[0])
+
feed.items.insert(0,
PyRSS2Gen.RSSItem(
title,
pubDate = pubdate,
description = description,
- author = cgi.escape(msg['Maintainer']),
+ author = cgi.escape(author),
link = link,
guid = link
)
--
2.1.1
Reply to: