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.
Method Summary
  __init__(self, xmlnode_or_node)
Initialize an DiscoItems object.
  __del__(self)
DiscoItem. add_item(self, jid, node, name, action)
Add a new item to the DiscoItems object.
list of DiscoItem get_items(self)
Get the items contained in self.
unicode get_node(self)
Get the node address of the DiscoItems object.
bool 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
libxml2.xmlNode or libxml2.xmlDoc 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)

Instance Variable Summary
tuple of DiscoItem items: items in the disco#items element (cached).
unicode node: node name of the disco#items element (cached).
libxml2.xmlNode xmlnode: XML element listing the items.

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.
           (type=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.
           (type=pyxmpp.JID)
node - item node name.
           (type=unicode)
name - item name.
           (type=unicode)
action - action for a "disco push".
           (type=unicode)
Returns:
the item created.
           (type=DiscoItem.)

get_items(self)

Get the items contained in self.
Returns:
the items contained.
           (type=list of DiscoItem)

get_node(self)

Get the node address of the DiscoItems object.
Returns:
the node name.
           (type=unicode)

has_item(self, jid, node=None)

Check if self contains an item.
Parameters:
jid - JID of the item.
           (type=JID)
node - node name of the item.
           (type=libxml2.xmlNode)
Returns:
True if the item is found in self.
           (type=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).
           (type=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.
           (type=unicode)

Instance Variable Details

items

items in the disco#items element (cached).
Type:
tuple of DiscoItem

node

node name of the disco#items element (cached).
Type:
unicode

xmlnode

XML element listing the items.
Type:
libxml2.xmlNode