diff --git a/VERSION b/VERSION index 41d8cfdb..6cb17dde 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.2.1 (2012-11-04 19:29:10) stable +Version 2.2.1 (2012-11-04 19:55:09) stable diff --git a/gluon/contrib/rss2.py b/gluon/contrib/rss2.py index 155de0e7..a39f15a1 100644 --- a/gluon/contrib/rss2.py +++ b/gluon/contrib/rss2.py @@ -45,6 +45,7 @@ __author__ = "Andrew Dalke " _generator_name = __name__ + "-" + ".".join(map(str, __version__)) import datetime + import sys if sys.version_info[0] == 3: @@ -519,25 +520,3 @@ class RSSItem(WriteXmlMixin): # Derived classes can hook into this to insert # output after the title and link elements pass - - -def dumps(rss, encoding='utf-8'): - s = StringIO() - rss.write_xml(s, encoding) - return s.getvalue() - - -def test(): - rss = RSS2(title='web2py feed', link='http://www.web2py.com', - description='About web2py', - lastBuildDate=datetime.datetime.now(), - items=[RSSItem(title='web2py and PyRSS2Gen-0.0', - link='http://www.web2py.com/examples/simple_examples/getrss', - description='web2py can now make rss feeds!', - guid=Guid('http://www.web2py.com/'), - pubDate=datetime.datetime(2007, 11, 14, 10, 30))]) - return dumps(rss) - - -if __name__ == '__main__': - print test() diff --git a/gluon/serializers.py b/gluon/serializers.py index b50ab994..ea9611d3 100644 --- a/gluon/serializers.py +++ b/gluon/serializers.py @@ -114,4 +114,4 @@ def rss(feed): description=str(entry.get('description', '')), pubDate=entry.get('created_on', now) ) for entry in feed.get('entries', [])]) - return rss2.dumps(rss) + return rss.to_xml(rss,encoding='utf-8')