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

Type DiscoIdentity

                object --+    
                         |    
      CachedPropertyObject --+
                             |
                object --+   |
                         |   |
StanzaPayloadWrapperObject --+
                             |
                            DiscoIdentity


An <identity/> element of disco#info reply.

Identifies an item by its name, category and type.


Method Summary
  __init__(self, disco, xmlnode_or_name, item_category, item_type, replace)
Initialize an DiscoIdentity object.
  __del__(self)
  __str__(self)
unicode get_category(self)
Get the category of the item.
unicode get_name(self)
Get the name of the item.
unicode get_type(self)
Get the type of the item.
  remove(self)
Remove self from the containing DiscoInfo object.
  set_category(self, category)
Set the category of the item.
  set_name(self, name)
Set the name of the item.
  set_type(self, item_type)
Set the type of the item.
    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)

Instance Variable Summary
DiscoInfo disco: the disco reply this is the part of.
libxml2.xmlNode xmlnode: XML element describing the identity.

Method Details

__init__(self, disco, xmlnode_or_name, item_category=None, item_type=None, replace=False)
(Constructor)

Initialize an DiscoIdentity object.
Parameters:
disco - the disco#info reply self is a part of.
           (type=DiscoItems)
xmlnode_or_name - XML element describing the identity or the name of the item described.
           (type=libxml2.xmlNode or unicode)
item_category - category of the item described.
           (type=unicode)
item_type - type of the item described.
           (type=unicode)
replace - if True than all other <identity/> elements in disco will be removed.
           (type=bool)
Overrides:
__builtin__.object.__init__

get_category(self)

Get the category of the item.
Returns:
the category of the item.
           (type=unicode)

get_name(self)

Get the name of the item.
Returns:
the name of the item or None.
           (type=unicode)

get_type(self)

Get the type of the item.
Returns:
the type of the item.
           (type=unicode)

remove(self)

Remove self from the containing DiscoInfo object.

set_category(self, category)

Set the category of the item.
Parameters:
category - the new category.
           (type=unicode)

set_name(self, name)

Set the name of the item.
Parameters:
name - the new name or None.
           (type=unicode)

set_type(self, item_type)

Set the type of the item.
Parameters:
item_type - the new type.
           (type=unicode)

Instance Variable Details

disco

the disco reply this is the part of.
Type:
DiscoInfo

xmlnode

XML element describing the identity.
Type:
libxml2.xmlNode