twisted.protocols.jabber.client.IQ

Package twisted :: Package protocols :: Package jabber :: Module client :: Class IQ |
[frames | no frames]

## Class IQ

    object --+
             |
       Element --+
                 |
                IQ

Wrapper for a Info/Query packet

This provides the necessary functionality to send IQs and get notified when a result comes back. It's a subclass from domish.Element, so you can use the standard DOM manipulation calls to add data to the outbound request.

Method Summary
| ``__init__`(self, xmlstream, type)`
| `_resultEvent(self, iq)`
| ``addCallback`(self, fn, *args, **kwargs)` Register a callback for notification when the IQ result is available.
| ``send`(self, to)` Call this method to send this IQ request via the associated XmlStream
Inherited from Element
| ``__delitem__`(self, key)`
| ``__getattr__`(self, key)`
| ``__getitem__`(self, key)`
| ``__setitem__`(self, key, value)`
| ``__str__`(self)` Retrieve the first CData (content) node
| ``_dqa`(self, attr)` Dequalify an attribute key as needed
| ``addChild`(self, node)` Add a child to this Element
| ``addContent`(self, text)` Add some text data to this element
| ``addElement`(self, name, defaultUri, content)` Add a new child Element to this Element; preferred method
| ``addRawXml`(self, rawxmlstring)` Add a pre-serialized chunk o' XML as a child of this Element.
| ``addUniqueId`(self)` Add a unique (across a given Python session) id attribute to this Element
| ``compareAttribute`(self, attrib, value)` Safely compare the value of an attribute against a provided value; None-safe.
| ``elements`(self)` Iterate across all children of this Element that are Elements
| ``firstChildElement`(self)`
| ``getAttribute`(self, attribname, default)` Retrieve the value of attribname, if it exists
| ``hasAttribute`(self, attrib)` Determine if the specified attribute exists
| ``swapAttributeValues`(self, left, right)` Swap the values of two attribute
| ``toXml`(self, prefixes, closeElement)` Serialize this Element and all children to a string
Inherited from object
| `__delattr__(...)`
| `__getattribute__(...)`
| `__hash__(...)`
| `__reduce__(...)`
| `__repr__(...)`
| `__setattr__(...)`
Inherited from type
| `__new__(...)`

Instance Variable Summary
Inherited from Element
`dict` | `attributes`: Dictionary of attributes associated with this Element.
`list` | `children`: List of child Elements and content
`str` | `defaultUri`: URI this Element exists within
`str` | `name`: Name of this Element
`Element` | `parent`: Reference to the parent Element, if any.
`str` | `uri`: URI of this Element's name

Class Variable Summary
`hemp.utility.CallbackList` | `callbacks`: Callback list to be notified when response comes back
Inherited from Element
`int` | `_idCounter` = 0

Method Details

### __init__(self, xmlstream, type='set') (Constructor) Parameters: `xmlstream` - XmlStream to use for transmission of this IQ (type=`XmlStream`) `type` - IQ type identifier ('get' or 'set') (type=`str`) Overrides: `twisted.xish.domish.Element.__init__`

### addCallback(self, fn, *args, **kwargs) Register a callback for notification when the IQ result is available.

### send(self, to=None) Call this method to send this IQ request via the associated XmlStream Parameters: `to` (type=Jabber ID of the entity to send the request to) Returns: Callback list for this IQ. Any callbacks added to this list will be fired when the result comes back.

Class Variable Details

### callbacks Callback list to be notified when response comes back Type: `hemp.utility.CallbackList`

Generated by Epydoc 2.0 on Sat May 15 20:08:34 2004 | http://epydoc.sf.net