Package pyxmpp :: Package jabber :: Module register :: Class Register
[show private | hide private]
[frames | no frames]

Type Register

         object --+    
                  |    
StanzaPayloadObject --+
                      |
                     Register


Delayed delivery tag.

Represents 'jabber:iq:register' (JEP-0077) element of a Jabber <iq/> stanza.

Please note that it is recommended to use `get_form` and `submit_form` records
instead of accessing the `form` and legacy fields directly. This way both
legacy and Data Forms registration would work transparently to the application.

:Ivariables:
    - `form`: registration form (when available)
    - `registered`: `True` if entity is already registered
    - `instrutions`: Registration instructions (legacy protocol)
    - `username`: Username field (legacy protocol)
    - `nick`: Nickname (legacy protocol)
    - `password`: Password (legacy protocol)
    - `name`: Name field (legacy protocol)
    - `first`: First name field (legacy protocol)
    - `last`: Last name field (legacy protocol)
    - `email`: E-mail field (legacy protocol)
    - `address`: Address field (legacy protocol)
    - `city`: City field (legacy protocol)
    - `state`: State field (legacy protocol)
    - `zip`: ZIP code field (legacy protocol)
    - `phone`: Phone field (legacy protocol)
    - `url`: URL field (legacy protocol)
    - `date`: Date field (legacy protocol)
    - `misc`: Misc field (legacy protocol, obsolete)
    - `text`: Text field (legacy protocol, obsolete)
    - `key`: Key field (legacy protocol, obsolete)
    - `remove`: `True` when the account should be removed
:Types:
    - `form`: `pyxmpp.jabber.dataforms.Form`
    - `registered`: `bool`
    - `instrutions`: `unicode`
    - `username`: `unicode`
    - `nick`: `unicode`
    - `password`: `unicode`
    - `name`: `unicode`
    - `first`: `unicode`
    - `last`: `unicode`
    - `email`: `unicode`
    - `address`: `unicode`
    - `city`: `unicode`
    - `state`: `unicode`
    - `zip`: `unicode`
    - `phone`: `unicode`
    - `url`: `unicode`
    - `date`: `unicode`
    - `misc`: `unicode`
    - `text`: `unicode`
    - `key`: `unicode`
    - `remove`: `True` when the account should be removed

Method Summary
  __init__(self, xmlnode)
Initialize the `Register` object.
  complete_xml_element(self, xmlnode, doc)
Complete the XML node with `self` content.
  get_form(self, form_type)
Return Data Form for the `Register` object.
  submit_form(self, form)
Make `Register` object for submitting the registration form.
  __from_xml(self, xmlnode)
Initialize `Register` from an XML node.
    Inherited from StanzaPayloadObject
  as_xml(self, parent, doc)
Get the XML representation of `self`.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
str xml_element_name = 'query'
str xml_element_namespace = 'jabber:iq:register'

Method Details

__init__(self, xmlnode=None)
(Constructor)

Initialize the `Register` object.

:Parameters:
    - `xmlnode`: an optional XML node to parse.
:Types:
    - `xmlnode`: `libxml2.xmlNode`
Overrides:
__builtin__.object.__init__

complete_xml_element(self, xmlnode, doc)

Complete the XML node with `self` content.

:Parameters:
    - `xmlnode`: XML node with the element being built. It has already
      right name and namespace, but no attributes or content.
    - `doc`: document to which the element belongs.
:Types:
    - `xmlnode`: `libxml2.xmlNode`
    - `doc`: `libxml2.xmlDoc`
Overrides:
pyxmpp.objects.StanzaPayloadObject.complete_xml_element

get_form(self, form_type='form')

Return Data Form for the `Register` object.

Convert legacy fields to a data form if `self.form` is `None`, return `self.form` otherwise.

:Parameters:
    - `form_type`: If "form", then a form to fill-in should be
      returned. If "sumbit", then a form with submitted data.
:Types:
    - `form_type`: `unicode`

:return: `self.form` or a form created from the legacy fields
:returntype: `pyxmpp.jabber.dataforms.Form`

submit_form(self, form)

Make `Register` object for submitting the registration form.

Convert form data to legacy fields if `self.form` is `None`.

:Parameters:
    - `form`: The form to submit. Its type doesn't have to be "submit"
      (a "submit" form will be created here), so it could be the form
      obtained from `get_form` just with the data entered.

:return: new registration element
:returntype: `Register`

__from_xml(self, xmlnode)

Initialize `Register` from an XML node.

:Parameters:
    - `xmlnode`: the jabber:x:register XML element.
:Types:
    - `xmlnode`: `libxml2.xmlNode`

Class Variable Details

xml_element_name

Type:
str
Value:
'query'                                                                

xml_element_namespace

Type:
str
Value:
'jabber:iq:register'                                                   

Generated by Epydoc 2.1 on Wed May 31 22:36:58 2006 http://epydoc.sf.net