Update PyRSS2Gen to 1.1

Pull functional changes adapted to in-tree calibre cleanups. Upstream
officially supports python3 so this should be all that is needed.
This commit is contained in:
Eli Schwartz 2019-03-14 16:38:10 -04:00
parent 9505fdf226
commit e37cf6ab3c

View File

@ -1,7 +1,7 @@
"""PyRSS2Gen - A Python library for generating RSS 2.0 feeds.""" """PyRSS2Gen - A Python library for generating RSS 2.0 feeds."""
__name__ = "PyRSS2Gen" __name__ = "PyRSS2Gen"
__version__ = (1, 0, 0) __version__ = (1, 1, 0)
__author__ = "Andrew Dalke <dalke@dalkescientific.com>" __author__ = "Andrew Dalke <dalke@dalkescientific.com>"
_generator_name = __name__ + "-" + ".".join(map(str, __version__)) _generator_name = __name__ + "-" + ".".join(map(str, __version__))
@ -22,12 +22,8 @@ class WriteXmlMixin:
handler.endDocument() handler.endDocument()
def to_xml(self, encoding="iso-8859-1"): def to_xml(self, encoding="iso-8859-1"):
try: import io
import cStringIO as StringIO f = io.StringIO()
StringIO
except ImportError:
import StringIO
f = StringIO.StringIO()
self.write_xml(f, encoding) self.write_xml(f, encoding)
return f.getvalue() return f.getvalue()
@ -387,7 +383,7 @@ class RSS2(WriteXmlMixin):
ttl = self.ttl ttl = self.ttl
if isinstance(self.ttl, numbers.Integral): if isinstance(self.ttl, numbers.Integral):
ttl = IntElement("ttl", ttl) ttl = IntElement("ttl", ttl)
_opt_element(handler, "tt", ttl) _opt_element(handler, "ttl", ttl)
if self.image is not None: if self.image is not None:
self.image.publish(handler) self.image.publish(handler)