[library-web] mallard: add compatibility with older ElementTree versions
- From: Frederic Peters <fpeters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [library-web] mallard: add compatibility with older ElementTree versions
- Date: Sun, 26 Jan 2014 14:33:31 +0000 (UTC)
commit b0ec6ee2d25b9512aeec195948f1883ae958e425
Author: Frédéric Péters <fpeters 0d be>
Date: Sun Jan 26 14:32:59 2014 +0000
mallard: add compatibility with older ElementTree versions
src/modtypes/mallard.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index 9b1aa4d..2bee270 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -101,7 +101,13 @@ class MallardPage:
if desc_tag is not None:
self.desc = plain_text(desc_tag)
- title_text = tree.find("{%s}info/{%s}title[ type='text']" % (MAL_NS, MAL_NS))
+ # unfortunately ElementText on RHEL 6.5 doesn't support attribute
+ # lookup, so we do your own loop.
+ # title_text = tree.find("{%s}info/{%s}title[ type='text']" % (MAL_NS, MAL_NS))
+ info_title_tag = None
+ for info_title_tag in tree.findall("{%s}info/{%s}title" % (MAL_NS, MAL_NS)):
+ if info_title_tag.attrib.get('type') == 'text':
+ title_text = info_title_tag
if title_text is not None:
self.title = plain_text(title_text)
else:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]