diff options
author | mathieui <mathieui@mathieui.net> | 2014-12-08 17:16:17 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-12-08 17:16:17 +0100 |
commit | 82a5a69f6f86aa8b7ebf8313f77338bc9f927027 (patch) | |
tree | 5a7fd4b50da0fa7ac807930f6de25e882da9c0c9 /src/tabs/xmltab.py | |
parent | e273a32ec727700d592723c4e5905510c71ed632 (diff) | |
download | poezio-82a5a69f6f86aa8b7ebf8313f77338bc9f927027.tar.gz poezio-82a5a69f6f86aa8b7ebf8313f77338bc9f927027.tar.bz2 poezio-82a5a69f6f86aa8b7ebf8313f77338bc9f927027.tar.xz poezio-82a5a69f6f86aa8b7ebf8313f77338bc9f927027.zip |
Fix /filter_xmlmask
Diffstat (limited to 'src/tabs/xmltab.py')
-rw-r--r-- | src/tabs/xmltab.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tabs/xmltab.py b/src/tabs/xmltab.py index 30b5b1c3..d6bdf35d 100644 --- a/src/tabs/xmltab.py +++ b/src/tabs/xmltab.py @@ -13,6 +13,7 @@ log = logging.getLogger(__name__) import curses import os from slixmpp.xmlstream import matcher +from slixmpp.xmlstream.tostring import tostring from slixmpp.xmlstream.stanzabase import ElementBase from xml.etree import ElementTree as ET @@ -50,7 +51,7 @@ class MatchJID(object): MATCHERS_MAPPINGS = { MatchJID: ('JID', lambda obj: repr(obj)), matcher.MatcherId: ('ID', lambda obj: obj._criteria), - matcher.MatchXMLMask: ('XMLMask', lambda obj: obj._criteria), + matcher.MatchXMLMask: ('XMLMask', lambda obj: tostring(obj._criteria)), matcher.MatchXPath: ('XPath', lambda obj: obj._criteria) } @@ -163,8 +164,8 @@ class XMLTab(Tab): try: self.update_filters(matcher.MatchXMLMask(mask)) self.refresh() - except: - self.core.information('Invalid XML Mask', 'Error') + except Exception as e: + self.core.information('Invalid XML Mask: %s' % e, 'Error') self.command_reset('') @command_args_parser.raw |