Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Jajcus/pyxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/pyxmpp
diff options
context:
space:
mode:
authorJacek Konieczny <jajcus@jajcus.net>2010-04-04 21:27:08 +0400
committerJacek Konieczny <jajcus@jajcus.net>2010-04-04 21:27:08 +0400
commit4c07f722d6d753bdd6beafbed925c1a795f5a326 (patch)
treec6ed4a1daccf389f2093bd045fe6f1fe0fac62c8 /pyxmpp
parentbf98f8a84dfcbb93fcb2c1c13c81ed33c1d76336 (diff)
- use 'classmethod' as decorator
Diffstat (limited to 'pyxmpp')
-rw-r--r--pyxmpp/jabber/dataforms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pyxmpp/jabber/dataforms.py b/pyxmpp/jabber/dataforms.py
index d266d89..2564f49 100644
--- a/pyxmpp/jabber/dataforms.py
+++ b/pyxmpp/jabber/dataforms.py
@@ -90,6 +90,7 @@ class Option(StanzaPayloadObject):
xmlnode.newTextChild(xmlnode.ns(), "value", self.value.encode("utf-8"))
return xmlnode
+ @classmethod
def _new_from_xml(cls, xmlnode):
"""Create a new `Option` object from an XML element.
@@ -111,7 +112,6 @@ class Option(StanzaPayloadObject):
if value is None:
raise BadRequestProtocolError, "No value in <option/> element"
return cls(value, label)
- _new_from_xml = classmethod(_new_from_xml)
class Field(StanzaPayloadObject):
"""A data form field.
@@ -293,6 +293,7 @@ class Field(StanzaPayloadObject):
xmlnode.newTextChild(xmlnode.ns(), "desc", to_utf8(self.desc))
return xmlnode
+ @classmethod
def _new_from_xml(cls, xmlnode):
"""Create a new `Field` object from an XML element.
@@ -327,7 +328,6 @@ class Field(StanzaPayloadObject):
if field_type and not field_type.endswith("-multi") and len(values) > 1:
raise BadRequestProtocolError, "Multiple values for a single-value field"
return cls(name, values, field_type, label, options, required, desc)
- _new_from_xml = classmethod(_new_from_xml)
class Item(StanzaPayloadObject):
"""An item of multi-item form data (e.g. a search result).
@@ -432,6 +432,7 @@ class Item(StanzaPayloadObject):
for field in self.fields:
field.as_xml(xmlnode, doc)
+ @classmethod
def _new_from_xml(cls, xmlnode):
"""Create a new `Item` object from an XML element.
@@ -452,7 +453,6 @@ class Item(StanzaPayloadObject):
fields.append(Field._new_from_xml(child))
child = child.next
return cls(fields)
- _new_from_xml = classmethod(_new_from_xml)
class Form(StanzaPayloadObject):
"""A JEP-0004 compliant data form.