pyxmpp.roster.RosterItem

Package pyxmpp :: Module roster :: Class RosterItem |
[show private | hide private]
[frames | no frames]

## Type RosterItem

             object --+
                      |
    StanzaPayloadObject --+
                          |
                         RosterItem

Roster item.

Represents part of a roster, or roster update request.

Method Summary
| ``__init__`(self, node_or_jid, subscription, name, groups, ask)` Initialize a roster item from XML node or jid and optional attributes.
| `__str__(self)`
| ``complete_xml_element`(self, xmlnode, _unused)` Complete the XML node with `self` content.
| ``from_xml`(self, node)` Initialize RosterItem from XML node.
| ``make_roster_push`(self)` Make "roster push" IQ stanza from the item representing roster update request.
Inherited from StanzaPayloadObject
`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)
| ``__setattr__`(...)` x.__setattr__('name', value) <==> x.name = value

Class Variable Summary
`unicode` | `xml_element_name`: name for the XML element provided by the class.
`unicode` | `xml_element_namespace`: namespace URI for the XML element provided by the class.

Method Details

### __init__(self, node_or_jid, subscription='none', name=None, groups=(), ask=None) (Constructor) 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: `__builtin__.object.__init__`

### complete_xml_element(self, xmlnode, _unused) Complete the XML node with `self` content. Should be overriden in classes derived from `StanzaPayloadObject`. Parameters: `xmlnode` - XML node with the element being built. It has already right name and namespace, but no attributes or content. (type=`libxml2.xmlNode`) `_unused` - document to which the element belongs. (type=`libxml2.xmlDoc`) Overrides: `pyxmpp.objects.StanzaPayloadObject.complete_xml_element`

### from_xml(self, node) Initialize RosterItem from XML node.

### make_roster_push(self) Make "roster push" IQ stanza from the item representing roster update request.

Class Variable Details

    ### xml_element_name name for the XML element provided by the class. Type: `unicode` Value:
        'item'

    ### xml_element_namespace namespace URI for the XML element provided by the class. Type: `unicode` Value:
        'jabber:iq:roster'