Package pyxmpp :: Module roster :: Class RosterItem
[hide private]

Class RosterItem

source code

                 object --+    
                          |    
objects.StanzaPayloadObject --+
                              |
                             RosterItem

Roster item.

Represents part of a roster, or roster update request.

Instance Methods [hide private]
 
__init__(self, node_or_jid, subscription='none', name=None, groups=(), ask=None)
Initialize a roster item from XML node or jid and optional attributes.
source code
 
from_xml(self, node)
Initialize RosterItem from XML node.
source code
 
complete_xml_element(self, xmlnode, _unused)
Complete the XML node with self content.
source code
 
__str__(self)
str(x)
source code
 
make_roster_push(self)
Make "roster push" IQ stanza from the item representing roster update request.
source code

Inherited from objects.StanzaPayloadObject: as_xml

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
: unicode xml_element_name = 'item'
: name for the XML element provided by the class.
: unicode xml_element_namespace = 'jabber:iq:roster'
: namespace URI for the XML element provided by the class.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, node_or_jid, subscription='none', name=None, groups=(), ask=None)
(Constructor)

source code 
Initialize a roster item from XML node or jid and optional attributes.
Parameters:
  • node_or_jid - : XML node or JID
  • subscription - : subscription type ("none", "to", "from" or "both"
  • name - : item visible name
  • groups - : sequence of groups the item is member of
  • ask - : True if there was unreplied subsription or unsubscription request sent.
Overrides: object.__init__

complete_xml_element(self, xmlnode, _unused)

source code 

Complete the XML node with self content.

Should be overriden in classes derived from StanzaPayloadObject.

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

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)