From 70e7666eaf6765cbed0c16ec1da30bf0383533d8 Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Sun, 21 Apr 2013 15:18:24 +0200 Subject: [PATCH] feedgenerator: started with rss --- feedgenerator.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/feedgenerator.py b/feedgenerator.py index a44f4e4..2c61a6f 100644 --- a/feedgenerator.py +++ b/feedgenerator.py @@ -179,6 +179,7 @@ class FeedGenerator: def title(self, title=None): if not title is None: self.__atom_title = title + self.__rss_title = title return self.__atom_title @@ -240,6 +241,9 @@ class FeedGenerator: set(['href', 'rel', 'type', 'hreflang', 'title', 'length']), set(['href']), {'rel':['alternate', 'enclosure', 'related', 'self', 'via']} ) + # RSS only needs the URL: + self.__rss_link = [ l['href'] for l in self.__atom_link ] + # return the set with more information (atom) return self.__atom_link @@ -297,10 +301,21 @@ class FeedGenerator: def subtitle(self, subtitle=None): if not subtitle is None: - self.__atom_subtitle = subtitle + self.__atom_subtitle = subtitle + self.__rss_description = subtitle return self.__atom_subtitle + def description(self, description=None): + '''Set and get the description of the feed. This is a RSS only element + which is a phrase or sentence describing the channel. It is roughly the + same as atom:subtitle. Setting this will also set subtitle. + + :param description: Description/Subtitle of the channel. + ''' + return subtitle( description ) + + class FeedEntry: '''