def utf2ascii(src):
""" Return an ASCII encoded copy of the input UTF-8 string """
try:
- res = unicode(src, 'utf-8').encode('ascii', 'replace')
+ res = unicode(src, 'utf-8').encode('ascii', 'replace')
except UnicodeDecodeError:
res = None
return res
""" Purge RSSItem from feed, no more than max. """
if feed.items is None or len(feed.items) == 0:
return False
-
+
feed.items = feed.items[:max]
return True
feed.items.insert(0,
PyRSS2Gen.RSSItem(
- title,
+ title,
pubDate = msg['Date'],
# pubDate = now(),
description = description,