From ea65b672e75d2b544a2d9c3ef0d497c1e66075bc Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Sat, 12 Sep 2015 22:10:28 -0600 Subject: Initial cut at getting the stanzas to work. (cherry picked from commit 8c7df49) --- sleekxmpp/plugins/xep_0122/__init__.py | 1 + sleekxmpp/plugins/xep_0122/stanza.py | 83 ++++++++++++++++++++ tests/test_stanza_xep_0122.py | 137 +++++++++++++++++++++++++++++++++ 3 files changed, 221 insertions(+) create mode 100644 sleekxmpp/plugins/xep_0122/__init__.py create mode 100644 sleekxmpp/plugins/xep_0122/stanza.py create mode 100644 tests/test_stanza_xep_0122.py diff --git a/sleekxmpp/plugins/xep_0122/__init__.py b/sleekxmpp/plugins/xep_0122/__init__.py new file mode 100644 index 00000000..65ce96a1 --- /dev/null +++ b/sleekxmpp/plugins/xep_0122/__init__.py @@ -0,0 +1 @@ +from sleekxmpp.plugins.xep_0122.stanza import FormValidation diff --git a/sleekxmpp/plugins/xep_0122/stanza.py b/sleekxmpp/plugins/xep_0122/stanza.py new file mode 100644 index 00000000..1807b11c --- /dev/null +++ b/sleekxmpp/plugins/xep_0122/stanza.py @@ -0,0 +1,83 @@ + +from sleekxmpp.xmlstream import ElementBase, ET + + +class FormValidation(ElementBase): + """ + Validation values for form fields. + + Example: + + + + 2003-10-06T11:22:00-07:00 + + """ + + namespace = 'http://jabber.org/protocol/xdata-validate' + name = 'validate' + plugin_attrib = 'validate' + interfaces = set(('datatype', 'basic', 'open', 'range', 'regex', )) + sub_interfaces = set(('basic', 'open', 'range', 'regex', )) + plugin_attrib_map = {} + plugin_tag_map = {} + + def _add_field(self, name): + item_xml = ET.Element('{%s}%s' % (self.namespace, name)) + self.xml.append(item_xml) + return item_xml + + def set_basic(self, value): + self.remove_all() + if value: + self._add_field('basic') + + def set_open(self, value): + self.remove_all() + if value: + self._add_field('open') + + def set_regex(self, regex): + self.remove_all() + if regex: + _regex = self._add_field('regex') + _regex.text = regex + + def set_range(self, value, minimum=None, maximum=None): + self.remove_all() + if value: + _range = self._add_field('range') + _range.attrib['min'] = str(minimum) + _range.attrib['max'] = str(maximum) + + def remove_all(self, except_tag=None): + for a in self.sub_interfaces: + if a != except_tag: + del self[a] + + def get_basic(self): + present = self.xml.find('{%s}basic' % self.namespace) + return present is not None + + def get_open(self): + present = self.xml.find('{%s}open' % self.namespace) + return present is not None + + def get_regex(self): + present = self.xml.find('{%s}regex' % self.namespace) + if present: + return present.text + + return False + + def get_range(self): + present = self.xml.find('{%s}regex' % self.namespace) + if present: + return dict(present.attrib) + + return False + + +FormValidation.getBasic = FormValidation.get_basic +FormValidation.setBasic = FormValidation.set_basic diff --git a/tests/test_stanza_xep_0122.py b/tests/test_stanza_xep_0122.py new file mode 100644 index 00000000..2330b6a2 --- /dev/null +++ b/tests/test_stanza_xep_0122.py @@ -0,0 +1,137 @@ +import unittest +from sleekxmpp import Message +from sleekxmpp.test import SleekTest +from sleekxmpp.thirdparty import OrderedDict + +import sleekxmpp.plugins.xep_0004 as xep_0004 +import sleekxmpp.plugins.xep_0122 as xep_0122 +from sleekxmpp.xmlstream import register_stanza_plugin + + +class TestDataForms(SleekTest): + + def setUp(self): + register_stanza_plugin(Message, xep_0004.Form) + register_stanza_plugin(xep_0004.Form, xep_0004.FormField, iterable=True) + register_stanza_plugin(xep_0004.FormField, xep_0004.FieldOption, iterable=True) + register_stanza_plugin(xep_0004.FormField, xep_0122.FormValidation) + + def test_basic_validation(self): + """Testing using multiple instructions elements in a data form.""" + msg = self.Message() + form = msg['form'] + field = form.addField(var='f1', + ftype='text-single', + label='Text', + desc='A text field', + required=True, + value='Some text!') + + validation = field['validate'] + validation['datatype'] = 'xs:string' + validation.set_basic(True) + + self.check(msg, """ + + + + A text field + + Some text! + + + + + + + """) + + def test_open_validation(self): + """Testing using multiple instructions elements in a data form.""" + msg = self.Message() + form = msg['form'] + field = form.addField(var='f1', + ftype='text-single', + label='Text', + desc='A text field', + required=True, + value='Some text!') + + validation = field['validate'] + validation.set_open(True) + + self.check(msg, """ + + + + A text field + + Some text! + + + + + + + """) + + def test_regex_validation(self): + """Testing using multiple instructions elements in a data form.""" + msg = self.Message() + form = msg['form'] + field = form.addField(var='f1', + ftype='text-single', + label='Text', + desc='A text field', + required=True, + value='Some text!') + + validation = field['validate'] + validation.set_regex('[0-9]+') + + self.check(msg, """ + + + + A text field + + Some text! + + [0-9]+ + + + + + """) + + def test_range_validation(self): + """Testing using multiple instructions elements in a data form.""" + msg = self.Message() + form = msg['form'] + field = form.addField(var='f1', + ftype='text-single', + label='Text', + desc='A text field', + required=True, + value='Some text!') + + validation = field['validate'] + validation.set_range(True, minimum=0, maximum=10) + + self.check(msg, """ + + + + A text field + + Some text! + + + + + + + """) + + +suite = unittest.TestLoader().loadTestsFromTestCase(TestDataForms) -- cgit v1.2.3 From 5f9abe2e0e06b4cda898db90ba1b524640411e42 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 14 Sep 2015 17:04:16 -0600 Subject: Working through test case issues. (cherry picked from commit 6b58cef) --- sleekxmpp/plugins/xep_0122/stanza.py | 7 +- tests/test_stanza_xep_0122.py | 172 +++++++++++++++++------------------ 2 files changed, 89 insertions(+), 90 deletions(-) diff --git a/sleekxmpp/plugins/xep_0122/stanza.py b/sleekxmpp/plugins/xep_0122/stanza.py index 1807b11c..bf8545c8 100644 --- a/sleekxmpp/plugins/xep_0122/stanza.py +++ b/sleekxmpp/plugins/xep_0122/stanza.py @@ -24,28 +24,27 @@ class FormValidation(ElementBase): plugin_tag_map = {} def _add_field(self, name): + self.remove_all() item_xml = ET.Element('{%s}%s' % (self.namespace, name)) self.xml.append(item_xml) return item_xml def set_basic(self, value): - self.remove_all() if value: self._add_field('basic') + else: + self['basic'] = False def set_open(self, value): - self.remove_all() if value: self._add_field('open') def set_regex(self, regex): - self.remove_all() if regex: _regex = self._add_field('regex') _regex.text = regex def set_range(self, value, minimum=None, maximum=None): - self.remove_all() if value: _range = self._add_field('range') _range.attrib['min'] = str(minimum) diff --git a/tests/test_stanza_xep_0122.py b/tests/test_stanza_xep_0122.py index 2330b6a2..6e1e4d7b 100644 --- a/tests/test_stanza_xep_0122.py +++ b/tests/test_stanza_xep_0122.py @@ -46,92 +46,92 @@ class TestDataForms(SleekTest): """) - def test_open_validation(self): - """Testing using multiple instructions elements in a data form.""" - msg = self.Message() - form = msg['form'] - field = form.addField(var='f1', - ftype='text-single', - label='Text', - desc='A text field', - required=True, - value='Some text!') - - validation = field['validate'] - validation.set_open(True) - - self.check(msg, """ - - - - A text field - - Some text! - - - - - - - """) - - def test_regex_validation(self): - """Testing using multiple instructions elements in a data form.""" - msg = self.Message() - form = msg['form'] - field = form.addField(var='f1', - ftype='text-single', - label='Text', - desc='A text field', - required=True, - value='Some text!') - - validation = field['validate'] - validation.set_regex('[0-9]+') - - self.check(msg, """ - - - - A text field - - Some text! - - [0-9]+ - - - - - """) - - def test_range_validation(self): - """Testing using multiple instructions elements in a data form.""" - msg = self.Message() - form = msg['form'] - field = form.addField(var='f1', - ftype='text-single', - label='Text', - desc='A text field', - required=True, - value='Some text!') - - validation = field['validate'] - validation.set_range(True, minimum=0, maximum=10) - - self.check(msg, """ - - - - A text field - - Some text! - - - - - - - """) + # def test_open_validation(self): + # """Testing using multiple instructions elements in a data form.""" + # msg = self.Message() + # form = msg['form'] + # field = form.addField(var='f1', + # ftype='text-single', + # label='Text', + # desc='A text field', + # required=True, + # value='Some text!') + # + # validation = field['validate'] + # validation.set_open(True) + # + # self.check(msg, """ + # + # + # + # A text field + # + # Some text! + # + # + # + # + # + # + # """) + # + # def test_regex_validation(self): + # """Testing using multiple instructions elements in a data form.""" + # msg = self.Message() + # form = msg['form'] + # field = form.addField(var='f1', + # ftype='text-single', + # label='Text', + # desc='A text field', + # required=True, + # value='Some text!') + # + # validation = field['validate'] + # validation.set_regex('[0-9]+') + # + # self.check(msg, """ + # + # + # + # A text field + # + # Some text! + # + # [0-9]+ + # + # + # + # + # """) + # + # def test_range_validation(self): + # """Testing using multiple instructions elements in a data form.""" + # msg = self.Message() + # form = msg['form'] + # field = form.addField(var='f1', + # ftype='text-single', + # label='Text', + # desc='A text field', + # required=True, + # value='Some text!') + # + # validation = field['validate'] + # validation.set_range(True, minimum=0, maximum=10) + # + # self.check(msg, """ + # + # + # + # A text field + # + # Some text! + # + # + # + # + # + # + # """) suite = unittest.TestLoader().loadTestsFromTestCase(TestDataForms) -- cgit v1.2.3 From f2bf6072ec447cf5cc331b4057b29078b1c932b5 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 14 Sep 2015 16:35:47 -0600 Subject: Add plugin (cherry picked from commit 2296d56) --- sleekxmpp/plugins/xep_0122/data_validation.py | 19 +++ sleekxmpp/plugins/xep_0122/stanza.py | 34 +++-- tests/test_stanza_xep_0122.py | 196 ++++++++++++++------------ 3 files changed, 150 insertions(+), 99 deletions(-) create mode 100644 sleekxmpp/plugins/xep_0122/data_validation.py diff --git a/sleekxmpp/plugins/xep_0122/data_validation.py b/sleekxmpp/plugins/xep_0122/data_validation.py new file mode 100644 index 00000000..6f6cbe8c --- /dev/null +++ b/sleekxmpp/plugins/xep_0122/data_validation.py @@ -0,0 +1,19 @@ +from sleekxmpp.xmlstream import register_stanza_plugin +from sleekxmpp.plugins import BasePlugin +from sleekxmpp.plugins.xep_0004 import stanza +from sleekxmpp.plugins.xep_0004.stanza import FormField +from sleekxmpp.plugins.xep_0122.stanza import FormValidation + + +class XEP_0122(BasePlugin): + """ + XEP-0004: Data Forms + """ + + name = 'xep_0122' + description = 'XEP-0122: Data Forms Validation' + dependencies = set(['xep_0004']) + stanza = stanza + + def plugin_init(self): + register_stanza_plugin(FormField, FormValidation, iterable=True) diff --git a/sleekxmpp/plugins/xep_0122/stanza.py b/sleekxmpp/plugins/xep_0122/stanza.py index bf8545c8..bc3c177a 100644 --- a/sleekxmpp/plugins/xep_0122/stanza.py +++ b/sleekxmpp/plugins/xep_0122/stanza.py @@ -13,13 +13,17 @@ class FormValidation(ElementBase): datatype='xs:dateTime'/> 2003-10-06T11:22:00-07:00 + + Questions: + Should this look at the datatype value and convert the range values as appropriate? + Should this stanza provide a pass/fail for a value from the field, or convert field value to datatype? """ namespace = 'http://jabber.org/protocol/xdata-validate' name = 'validate' plugin_attrib = 'validate' - interfaces = set(('datatype', 'basic', 'open', 'range', 'regex', )) - sub_interfaces = set(('basic', 'open', 'range', 'regex', )) + interfaces = {'datatype', 'basic', 'open', 'range', 'regex', } + sub_interfaces = {'basic', 'open', 'range', 'regex', } plugin_attrib_map = {} plugin_tag_map = {} @@ -33,22 +37,28 @@ class FormValidation(ElementBase): if value: self._add_field('basic') else: - self['basic'] = False + del self['basic'] def set_open(self, value): if value: self._add_field('open') + else: + del self['open'] def set_regex(self, regex): if regex: _regex = self._add_field('regex') _regex.text = regex + else: + del self['regex'] def set_range(self, value, minimum=None, maximum=None): if value: _range = self._add_field('range') _range.attrib['min'] = str(minimum) _range.attrib['max'] = str(maximum) + else: + del self['range'] def remove_all(self, except_tag=None): for a in self.sub_interfaces: @@ -65,18 +75,20 @@ class FormValidation(ElementBase): def get_regex(self): present = self.xml.find('{%s}regex' % self.namespace) - if present: + if present is not None: return present.text return False def get_range(self): - present = self.xml.find('{%s}regex' % self.namespace) - if present: - return dict(present.attrib) + present = self.xml.find('{%s}range' % self.namespace) + if present is not None: + attributes = present.attrib + return_value = dict() + if 'min' in attributes: + return_value['minimum'] = attributes['min'] + if 'max' in attributes: + return_value['maximum'] = attributes['max'] + return return_value return False - - -FormValidation.getBasic = FormValidation.get_basic -FormValidation.setBasic = FormValidation.set_basic diff --git a/tests/test_stanza_xep_0122.py b/tests/test_stanza_xep_0122.py index 6e1e4d7b..5576c45f 100644 --- a/tests/test_stanza_xep_0122.py +++ b/tests/test_stanza_xep_0122.py @@ -1,8 +1,7 @@ import unittest + from sleekxmpp import Message from sleekxmpp.test import SleekTest -from sleekxmpp.thirdparty import OrderedDict - import sleekxmpp.plugins.xep_0004 as xep_0004 import sleekxmpp.plugins.xep_0122 as xep_0122 from sleekxmpp.xmlstream import register_stanza_plugin @@ -46,92 +45,113 @@ class TestDataForms(SleekTest): """) - # def test_open_validation(self): - # """Testing using multiple instructions elements in a data form.""" - # msg = self.Message() - # form = msg['form'] - # field = form.addField(var='f1', - # ftype='text-single', - # label='Text', - # desc='A text field', - # required=True, - # value='Some text!') - # - # validation = field['validate'] - # validation.set_open(True) - # - # self.check(msg, """ - # - # - # - # A text field - # - # Some text! - # - # - # - # - # - # - # """) - # - # def test_regex_validation(self): - # """Testing using multiple instructions elements in a data form.""" - # msg = self.Message() - # form = msg['form'] - # field = form.addField(var='f1', - # ftype='text-single', - # label='Text', - # desc='A text field', - # required=True, - # value='Some text!') - # - # validation = field['validate'] - # validation.set_regex('[0-9]+') - # - # self.check(msg, """ - # - # - # - # A text field - # - # Some text! - # - # [0-9]+ - # - # - # - # - # """) - # - # def test_range_validation(self): - # """Testing using multiple instructions elements in a data form.""" - # msg = self.Message() - # form = msg['form'] - # field = form.addField(var='f1', - # ftype='text-single', - # label='Text', - # desc='A text field', - # required=True, - # value='Some text!') - # - # validation = field['validate'] - # validation.set_range(True, minimum=0, maximum=10) - # - # self.check(msg, """ - # - # - # - # A text field - # - # Some text! - # - # - # - # - # - # - # """) + self.assertTrue(validation.get_basic()) + self.assertFalse(validation.get_open()) + self.assertFalse(validation.get_range()) + self.assertFalse(validation.get_regex()) + + def test_open_validation(self): + """Testing using multiple instructions elements in a data form.""" + msg = self.Message() + form = msg['form'] + field = form.addField(var='f1', + ftype='text-single', + label='Text', + desc='A text field', + required=True, + value='Some text!') + + validation = field['validate'] + validation.set_open(True) + + self.check(msg, """ + + + + A text field + + Some text! + + + + + + + """) + + self.assertFalse(validation.get_basic()) + self.assertTrue(validation.get_open()) + self.assertFalse(validation.get_range()) + self.assertFalse(validation.get_regex()) + + def test_regex_validation(self): + """Testing using multiple instructions elements in a data form.""" + msg = self.Message() + form = msg['form'] + field = form.addField(var='f1', + ftype='text-single', + label='Text', + desc='A text field', + required=True, + value='Some text!') + + regex_value = '[0-9]+' + + validation = field['validate'] + validation.set_regex(regex_value) + + self.check(msg, """ + + + + A text field + + Some text! + + [0-9]+ + + + + + """) + + self.assertFalse(validation.get_basic()) + self.assertFalse(validation.get_open()) + self.assertFalse(validation.get_range()) + self.assertTrue(validation.get_regex()) + + self.assertEqual(regex_value, validation.get_regex()) + + def test_range_validation(self): + """Testing using multiple instructions elements in a data form.""" + msg = self.Message() + form = msg['form'] + field = form.addField(var='f1', + ftype='text-single', + label='Text', + desc='A text field', + required=True, + value='Some text!') + + validation = field['validate'] + validation.set_range(True, minimum=0, maximum=10) + + self.check(msg, """ + + + + A text field + + Some text! + + + + + + + """) + + self.assertDictEqual(dict(minimum=str(0), maximum=str(10)), validation.get_range()) suite = unittest.TestLoader().loadTestsFromTestCase(TestDataForms) -- cgit v1.2.3 From 110cf25c6d6055e0decb6907bfc7d0df8434c839 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 14 Sep 2015 17:06:07 -0600 Subject: Add plugin support --- sleekxmpp/plugins/xep_0122/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sleekxmpp/plugins/xep_0122/__init__.py b/sleekxmpp/plugins/xep_0122/__init__.py index 65ce96a1..c0a0bc35 100644 --- a/sleekxmpp/plugins/xep_0122/__init__.py +++ b/sleekxmpp/plugins/xep_0122/__init__.py @@ -1 +1,11 @@ + +from sleekxmpp.plugins.base import register_plugin from sleekxmpp.plugins.xep_0122.stanza import FormValidation +from sleekxmpp.plugins.xep_0122.data_validation import XEP_0122 + + +register_plugin(XEP_0122) + + +# Retain some backwards compatibility +xep_0121 = XEP_0122 -- cgit v1.2.3 From 83953af53d4537b119832518faa35352ca1202ec Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 14 Sep 2015 20:28:55 -0600 Subject: Missing xep_122 dir in setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 566683b7..1cd245aa 100755 --- a/setup.py +++ b/setup.py @@ -93,6 +93,7 @@ packages = [ 'sleekxmpp', 'sleekxmpp/plugins/xep_0108', 'sleekxmpp/plugins/xep_0115', 'sleekxmpp/plugins/xep_0118', + 'sleekxmpp/plugins/xep_0122', 'sleekxmpp/plugins/xep_0128', 'sleekxmpp/plugins/xep_0131', 'sleekxmpp/plugins/xep_0152', -- cgit v1.2.3 From 2a127a57a7790626c8a0bb979ec6e10d96e4535d Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Tue, 15 Sep 2015 10:09:06 -0600 Subject: Add test case Reported->Data Form Validation Add a test case that will verify that reported fields can contain data form validation data. --- tests/test_stanza_xep_0122.py | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/tests/test_stanza_xep_0122.py b/tests/test_stanza_xep_0122.py index 5576c45f..fca49bbb 100644 --- a/tests/test_stanza_xep_0122.py +++ b/tests/test_stanza_xep_0122.py @@ -16,7 +16,7 @@ class TestDataForms(SleekTest): register_stanza_plugin(xep_0004.FormField, xep_0122.FormValidation) def test_basic_validation(self): - """Testing using multiple instructions elements in a data form.""" + """Testing basic validation setting and getting.""" msg = self.Message() form = msg['form'] field = form.addField(var='f1', @@ -51,7 +51,7 @@ class TestDataForms(SleekTest): self.assertFalse(validation.get_regex()) def test_open_validation(self): - """Testing using multiple instructions elements in a data form.""" + """Testing open validation setting and getting.""" msg = self.Message() form = msg['form'] field = form.addField(var='f1', @@ -85,7 +85,7 @@ class TestDataForms(SleekTest): self.assertFalse(validation.get_regex()) def test_regex_validation(self): - """Testing using multiple instructions elements in a data form.""" + """Testing regex validation setting and getting.""" msg = self.Message() form = msg['form'] field = form.addField(var='f1', @@ -123,7 +123,7 @@ class TestDataForms(SleekTest): self.assertEqual(regex_value, validation.get_regex()) def test_range_validation(self): - """Testing using multiple instructions elements in a data form.""" + """Testing range validation setting and getting.""" msg = self.Message() form = msg['form'] field = form.addField(var='f1', @@ -153,5 +153,37 @@ class TestDataForms(SleekTest): self.assertDictEqual(dict(minimum=str(0), maximum=str(10)), validation.get_range()) + def test_reported_field_validation(self): + """ + Testing adding validation to the field when it's stored in the reported. + :return: + """ + msg = self.Message() + form = msg['form'] + field = form.addReported(var='f1', ftype='text-single', label='Text') + validation = field['validate'] + validation.set_basic(True) + + form.addItem({'f1': 'Some text!'}) + + self.check(msg, """ + + + + + + + + + + + + Some text! + + + + + """) + suite = unittest.TestLoader().loadTestsFromTestCase(TestDataForms) -- cgit v1.2.3 From d9b47b33f5101b52e781780f1a9685c7281b3015 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Tue, 15 Sep 2015 10:20:37 -0600 Subject: Update __init__.py changed xep_0121 to xep_0122 --- sleekxmpp/plugins/xep_0122/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sleekxmpp/plugins/xep_0122/__init__.py b/sleekxmpp/plugins/xep_0122/__init__.py index c0a0bc35..4b3e9483 100644 --- a/sleekxmpp/plugins/xep_0122/__init__.py +++ b/sleekxmpp/plugins/xep_0122/__init__.py @@ -8,4 +8,4 @@ register_plugin(XEP_0122) # Retain some backwards compatibility -xep_0121 = XEP_0122 +xep_0122 = XEP_0122 -- cgit v1.2.3 From 329cb5a9f846ca0ce38c0d5730ba7da8480e50ae Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Thu, 17 Sep 2015 16:21:13 -0600 Subject: Add 0122 to plugin/__init__.py __all__ --- sleekxmpp/plugins/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sleekxmpp/plugins/__init__.py b/sleekxmpp/plugins/__init__.py index 2c90d357..f501687b 100644 --- a/sleekxmpp/plugins/__init__.py +++ b/sleekxmpp/plugins/__init__.py @@ -47,6 +47,7 @@ __all__ = [ 'xep_0108', # User Activity 'xep_0115', # Entity Capabilities 'xep_0118', # User Tune + 'xep_0122', # Data Forms Validation 'xep_0128', # Extended Service Discovery 'xep_0131', # Standard Headers and Internet Metadata 'xep_0133', # Service Administration -- cgit v1.2.3 From a7ac9692153ef28f55279a000e106622df7ccabb Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Thu, 17 Sep 2015 16:21:54 -0600 Subject: register_Stanza_plugin shouldn't be iterable Should not use iterable for registering the stanza plugins. --- sleekxmpp/plugins/xep_0122/data_validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sleekxmpp/plugins/xep_0122/data_validation.py b/sleekxmpp/plugins/xep_0122/data_validation.py index 6f6cbe8c..ec2cdfcc 100644 --- a/sleekxmpp/plugins/xep_0122/data_validation.py +++ b/sleekxmpp/plugins/xep_0122/data_validation.py @@ -16,4 +16,4 @@ class XEP_0122(BasePlugin): stanza = stanza def plugin_init(self): - register_stanza_plugin(FormField, FormValidation, iterable=True) + register_stanza_plugin(FormField, FormValidation) -- cgit v1.2.3