Package pyxmpp :: Package jabber :: Module disco :: Class DiscoItems
[show private | hide private]
[frames | no frames]

Type DiscoItems

                object --+    
                         |    
      CachedPropertyObject --+
                             |
                object --+   |
                         |   |
StanzaPayloadWrapperObject --+
                             |
                            DiscoItems


A disco#items response or publish-request object.

:Ivariables:
    - `node`: node name of the disco#items element (cached).
    - `items`: items in the disco#items element (cached).
    - `xmlnode`: XML element listing the items.
:Types:
    - `node`: `unicode`
    - `items`: `tuple` of `DiscoItem`
    - `xmlnode`: `libxml2.xmlNode`

Method Summary
  __init__(self, xmlnode_or_node)
Initialize an `DiscoItems` object.
  __del__(self)
  add_item(self, jid, node, name, action)
Add a new item to the `DiscoItems` object.
  get_items(self)
Get the items contained in `self`.
  get_node(self)
Get the node address of the `DiscoItems` object.
  has_item(self, jid, node)
Check if `self` contains an item.
  invalidate_items(self)
Clear cached item list.
  set_items(self, item_list)
Set items in the disco#items object.
  set_node(self, node)
Set the node of the disco#item element.
    Inherited from CachedPropertyObject
  __getattr__(self, name)
  __setattr__(self, name, value)
    Inherited from StanzaPayloadWrapperObject
  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)
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, xmlnode_or_node=None)
(Constructor)

Initialize an `DiscoItems` object.

Wrap an existing disco#items XML element or create a new one.

:Parameters:
    - `xmlnode_or_node`: XML node to be wrapped into `self` or an item
      node name.
:Types:
    - `xmlnode_or_node`: `libxml2.xmlNode` or `unicode`
Overrides:
__builtin__.object.__init__

add_item(self, jid, node=None, name=None, action=None)

Add a new item to the `DiscoItems` object.

:Parameters:
    - `jid`: item JID.
    - `node`: item node name.
    - `name`: item name.
    - `action`: action for a "disco push".
:Types:
    - `jid`: `pyxmpp.JID`
    - `node`: `unicode`
    - `name`: `unicode`
    - `action`: `unicode`

:returns: the item created.
:returntype: `DiscoItem`.

get_items(self)

Get the items contained in `self`.

:return: the items contained.
:returntype: `list` of `DiscoItem`

get_node(self)

Get the node address of the `DiscoItems` object.

:return: the node name.
:returntype: `unicode`

has_item(self, jid, node=None)

Check if `self` contains an item.

:Parameters:
    - `jid`: JID of the item.
    - `node`: node name of the item.
:Types:
    - `jid`: `JID`
    - `node`: `libxml2.xmlNode`

:return: `True` if the item is found in `self`.
:returntype: `bool`

invalidate_items(self)

Clear cached item list.

set_items(self, item_list)

Set items in the disco#items object.

All previous items are removed.

:Parameters:
    - `item_list`: list of items or item properties
      (jid,node,name,action).
:Types:
    - `item_list`: sequence of `DiscoItem` or sequence of sequences

set_node(self, node)

Set the node of the disco#item element.

:Parameters:
    - `node`: the new node or `None`.
:Types:
    - `node`: `unicode`

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