summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2cafb98)
Signed-off-by: Torsten Werner <twerner@debian.org>
import re
import sys
import time
import re
import sys
import time
from optparse import OptionParser
from datetime import datetime
from optparse import OptionParser
from datetime import datetime
-def utf2ascii(src):
- """ Return an ASCII encoded copy of the input UTF-8 string """
- try:
- res = unicode(src, 'utf-8').encode('ascii', 'replace')
- except UnicodeDecodeError:
- res = None
- return res
-
def purge_old_items(feed, max):
""" Purge RSSItem from feed, no more than max. """
if feed.items is None or len(feed.items) == 0:
def purge_old_items(feed, max):
""" Purge RSSItem from feed, no more than max. """
if feed.items is None or len(feed.items) == 0:
return False
description = "<pre>Description: %s\nChanges: %s\n</pre>" % \
return False
description = "<pre>Description: %s\nChanges: %s\n</pre>" % \
- (utf2ascii(cgi.escape(msg['Description'])),
- utf2ascii(cgi.escape(msg['Changes'])))
+ (cgi.escape(msg['Description']),
+ cgi.escape(msg['Changes']))
link = "http://ftp-master.debian.org/new/%s_%s.html" % \
(msg['Source'], msg['Version'])
link = "http://ftp-master.debian.org/new/%s_%s.html" % \
(msg['Source'], msg['Version'])
title,
pubDate = pubdate,
description = description,
title,
pubDate = pubdate,
description = description,
- author = utf2ascii(cgi.escape(msg['Maintainer'])),
+ author = cgi.escape(msg['Maintainer']),
link = link,
guid = link
)
link = link,
guid = link
)