Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0277.py @ 660:69a8bfd266a5
core, plugins: fixed bad use of children instead of elements() for domish.Element instances.
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 15 Oct 2013 19:28:34 +0200 |
parents | 47d3a22b4629 |
children | 3c304929af74 |
comparison
equal
deleted
inserted
replaced
659:b6c22d9f593a | 660:69a8bfd266a5 |
---|---|
83 def item2mbdata(self, item): | 83 def item2mbdata(self, item): |
84 """Convert an XML Item to microblog data used in bridge API | 84 """Convert an XML Item to microblog data used in bridge API |
85 @param item: domish.Element of microblog item | 85 @param item: domish.Element of microblog item |
86 @return: microblog data (dictionary)""" | 86 @return: microblog data (dictionary)""" |
87 try: | 87 try: |
88 entry_elt = filter(lambda x: x.name == "entry", item.children)[0] | 88 entry_elt = [child for child in item.elements() if child.name == "entry"][0] |
89 except KeyError: | 89 except IndexError: |
90 warning(_('No entry element in microblog item')) | 90 warning(_('No entry element in microblog item')) |
91 return | 91 return |
92 _entry = atom.Entry().import_xml(entry_elt.toXml().encode('utf-8')) | 92 _entry = atom.Entry().import_xml(entry_elt.toXml().encode('utf-8')) |
93 microblog_data = {} | 93 microblog_data = {} |
94 try: | 94 try: |