From 0a11860e014d5a70f2d17fd51de909224ed8444e Mon Sep 17 00:00:00 2001 From: Dannieboy Date: Fri, 1 Jan 2021 00:00:01 +0100 Subject: [PATCH] Made the module less strict without breaking the atom standart. --- feedgen/feed.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/feedgen/feed.py b/feedgen/feed.py index 9ebd219..c6fccbb 100644 --- a/feedgen/feed.py +++ b/feedgen/feed.py @@ -121,14 +121,9 @@ class FeedGenerator(object): if not a.get('name'): continue author = xml_elem('author', feed) - name = xml_elem('name', author) - name.text = a.get('name') - if a.get('email'): - email = xml_elem('email', author) - email.text = a.get('email') - if a.get('uri'): - uri = xml_elem('uri', author) - uri.text = a.get('uri') + for k in a.keys(): + e = xml_elem(k, author) + e.text = str(a.get(k)) for l in self.__atom_link or []: link = xml_elem('link', feed, href=l['href']) @@ -530,9 +525,7 @@ class FeedGenerator(object): if author is not None: if replace or self.__atom_author is None: self.__atom_author = [] - self.__atom_author += ensure_format(author, - set(['name', 'email', 'uri']), - set(['name'])) + self.__atom_author += [author] self.__rss_author = [] for a in self.__atom_author: if a.get('email'):