Package pyxmpp :: Package jabber :: Module vcard :: Class VCard |
[hide private]

# Class VCard

source code

                     object --+
                              |
    objects.StanzaPayloadObject --+
                                  |
                                 VCard

Jabber (vcard-temp) or RFC2426 vCard.

Instance Methods | [hide private]
__init__(self, data) Initialize a VCard object from data which may be XML node or an RFC2426 string. | source code
__make_fn(self) Initialize the mandatory self.fn from self.n. | source code
__from_xml(self, data) Initialize a VCard object from XML node. | source code
__from_rfc2426(self, data) Initialize a VCard object from an RFC2426 string. | source code
_process_rfc2425_record(self, data) Parse single RFC2425 record and update attributes of `self`. | source code
__repr__(self) repr(x) | source code
`str` |
rfc2426(self) Get the RFC2426 representation of `self`. | source code
complete_xml_element(self, xmlnode, _unused) Complete the XML node with `self` content. | source code
__getattr__(self, name) | source code
__getitem__(self, name) | source code
Inherited from `objects.StanzaPayloadObject`: `as_xml` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]
: `unicode` | xml_element_name = ``'``vCard``'`` : name for the XML element provided by the class.
: `unicode` | xml_element_namespace = ``'``vcard-temp``'`` : namespace URI for the XML element provided by the class.
| components = `{"FN":(VCardString, "required"), "N":(VCardName, `...``

Instance Variables | [hide private]
: `list` of VCardAdr | adr : address(es).
: `list` of VCardString | bday : birthday date(s).
: `list` of VCardCategories | categories : categories.
: `list` of VCardString | class : class(es).
: `list` of VCardXString | desc : description.
: `list` of VCardEmail | email : e-mail address(es).
: VCardString, | fn : full name.
: `list` of VCardGeo | geo : geolocation(s).
: `list` of VCardJID | jabberid : JID(s).
: `list` of VCardKey | key : key(s).
: `list` of VCardLabel | label : address label(s).
: `list` of VCardImage | logo : logo(s).
: `list` of VCardString | mailer : mailer(s).
: VCardName, | n : structural name.
: `list` of VCardString | nickname : nickname(s).
: `list` of VCardString | note : note(s).
: `list` of VCardOrg | org : organization(s).
: `list` of VCardImage | photo : photo(s).
: `list` of VCardString | prodid : product id(s).
: `list` of VCardString | rev : revision(s).
: `list` of VCardString | role : role(s).
: `list` of VCardString | sort-string : sort string(s).
: `list` of VCardSound | sound : sound(s).
: `list` of VCardTel | tel : phone number(s).
: `list` of VCardString | title : title(s).
: `list` of VCardString | tz : timezone(s).
: `list` of VCardString | uid : user identifier(s).
: `list` of VCardString | url : URL(s).

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, data) (Constructor) | source code
Initialize a VCard object from data which may be XML node or an RFC2426 string. Parameters: `data` (: `libxml2.xmlNode`, `unicode` or `str`) - : vcard to parse. Overrides: object.__init__

### __make_fn(self) | source code
Initialize the mandatory self.fn from self.n. This is a workaround for buggy clients which set only one of them.

### __from_xml(self, data) | source code
Initialize a VCard object from XML node. Parameters: `data` (: `libxml2.xmlNode`) - : vcard to parse.

### __from_rfc2426(self, data) | source code
Initialize a VCard object from an RFC2426 string. Parameters: `data` (: `libxml2.xmlNode`, `unicode` or `str`) - : vcard to parse.

### _process_rfc2425_record(self, data) | source code
Parse single RFC2425 record and update attributes of `self`. Parameters: `data` (: `unicode`) - : the record (probably multiline)

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)

### rfc2426(self) | source code
Get the RFC2426 representation of `self`. Returns: `str` the UTF-8 encoded RFC2426 representation.

### 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

Class Variable Details | [hide private]

  ### components Value:
      {'ADR': (<class pyxmpp.jabber.vcard.VCardAdr at 0x8a753bc>, 'multi'),
       'AGENT': ('VCardAgent', 'ignore'),
       'BDAY': (<class pyxmpp.jabber.vcard.VCardString at 0x8a752cc>,
                'multi'),
       'CATEGORIES': (<class pyxmpp.jabber.vcard.VCardCategories at 0x8a754d
      c>,
                      'multi'),
       'CLASS': (<class pyxmpp.jabber.vcard.VCardString at 0x8a752cc>, 'mult
      ...