Make Generator Optional (Atom)

This patch makes the field generator optional in Atom, allowing to set
an empty string to disable the element in the same way it is disabled in
RSS already:

```python
 # disable generator element
 fg.generator('')
```

This fixes #89
This commit is contained in:
Lars Kiesow 2020-01-24 17:51:37 +01:00
parent 26b64ca9fc
commit 5a68e682d9
No known key found for this signature in database
GPG key ID: 5DAFE8D9C823CE73

View file

@ -165,7 +165,7 @@ class FeedGenerator(object):
uri = etree.SubElement(contrib, 'uri')
uri.text = c.get('uri')
if self.__atom_generator:
if self.__atom_generator and self.__atom_generator.get('value'):
generator = etree.SubElement(feed, 'generator')
generator.text = self.__atom_generator['value']
if self.__atom_generator.get('uri'):