From 647db6494168424565e77556c16d6e26c2626b7b Mon Sep 17 00:00:00 2001 From: souliane Date: Tue, 25 Feb 2014 22:58:42 +0100 Subject: [PATCH] tools, plugin XEP-0077: small fixes --- src/plugins/plugin_xep_0077.py | 2 +- src/tools/misc.py | 2 +- src/tools/xml_tools.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/plugin_xep_0077.py b/src/plugins/plugin_xep_0077.py index 40e0213b..5d331d8a 100755 --- a/src/plugins/plugin_xep_0077.py +++ b/src/plugins/plugin_xep_0077.py @@ -62,7 +62,7 @@ class XEP_0077(object): except StopIteration: # XXX: it seems we have an old service which doesn't manage data forms warning(_("Can't find data form")) - raise DataError(_("This gateway can't be managed by SàT, sorry :(")) + raise exceptions.DataError(_("This gateway can't be managed by SàT, sorry :(")) def submitForm(data, profile): form_elt = xml_tools.XMLUIResultToElt(data) diff --git a/src/tools/misc.py b/src/tools/misc.py index a14b034c..b35c1e32 100644 --- a/src/tools/misc.py +++ b/src/tools/misc.py @@ -54,7 +54,7 @@ class TriggerManager(object): if point_name not in self.__triggers: self.__triggers[point_name] = [] if priority != 0 and priority in [trigger_tuple[0] for trigger_tuple in self.__triggers[point_name]]: - if priority in (MIN_PRIORITY, MAX_PRIORITY): + if priority in (self.MIN_PRIORITY, self.MAX_PRIORITY): warning(_("There is already a bound priority [%s]") % point_name) else: debug(_("There is already a trigger with the same priority [%s]") % point_name) diff --git a/src/tools/xml_tools.py b/src/tools/xml_tools.py index 9787d62a..13004986 100644 --- a/src/tools/xml_tools.py +++ b/src/tools/xml_tools.py @@ -331,7 +331,7 @@ class HeaderElement(Element): """" Used by AdvancedListContainer """ type = 'header' - def __init__(self, parent, name=None, Label=None, description=None): + def __init__(self, parent, name=None, label=None, description=None): """ @param parent: AdvancedListContainer instance @param name: name of the container @@ -342,11 +342,11 @@ class HeaderElement(Element): assert(isinstance(parent, AdvancedListContainer)) super(HeaderElement, self).__init__(parent.xmlui, parent) if name: - field_elt.setAttribute('name', name) + self.elem.setAttribute('name', name) if label: - field_elt.setAttribute('label', label) + self.elem.setAttribute('label', label) if description: - field_elt.setAttribute('description', description) + self.elem.setAttribute('description', description) class Container(Element): @@ -422,7 +422,7 @@ class AdvancedListContainer(Container): """ assert selectable in ('no', 'single') if not items and columns is None: - raise DataError(_("either items or columns need do be filled")) + raise exceptions.DataError(_("either items or columns need do be filled")) if headers is None: headers = [] if items is None: