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

Type VCard

         object --+    
                  |    
StanzaPayloadObject --+
                      |
                     VCard


Jabber (vcard-temp) or RFC2426 vCard.
Method Summary
  __init__(self, data)
Initialize a VCard object from data which may be XML node or an RFC2426 string.
  __getattr__(self, name)
  __getitem__(self, name)
  __repr__(self)
  complete_xml_element(self, xmlnode, _unused)
Complete the XML node with self content.
str rfc2426(self)
Get the RFC2426 representation of self.
  __from_rfc2426(self, data)
Initialize a VCard object from an RFC2426 string.
  __from_xml(self, data)
Initialize a VCard object from XML node.
  __make_fn(self)
Initialize the mandatory self.fn from self.n.
  _process_rfc2425_record(self, data)
Parse single RFC2425 record and update attributes of self.
    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
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Variable Summary
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).

Class Variable Summary
dict components = {'SOUND': (<class pyxmpp.jabber.vcard.VCard...
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, data)
(Constructor)

Initialize a VCard object from data which may be XML node or an RFC2426 string.
Parameters:
data - vcard to parse.
           (type=libxml2.xmlNode, unicode or str)
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

rfc2426(self)

Get the RFC2426 representation of self.
Returns:
the UTF-8 encoded RFC2426 representation.
           (type=str)

__from_rfc2426(self, data)

Initialize a VCard object from an RFC2426 string.
Parameters:
data - vcard to parse.
           (type=libxml2.xmlNode, unicode or str)

__from_xml(self, data)

Initialize a VCard object from XML node.
Parameters:
data - vcard to parse.
           (type=libxml2.xmlNode)

__make_fn(self)

Initialize the mandatory self.fn from self.n.

This is a workaround for buggy clients which set only one of them.

_process_rfc2425_record(self, data)

Parse single RFC2425 record and update attributes of self.
Parameters:
data - the record (probably multiline)
           (type=unicode)

Instance Variable Details

adr

address(es).
Type:
list of VCardAdr

bday

birthday date(s).
Type:
list of VCardString

categories

categories.
Type:
list of VCardCategories

class

class(es).
Type:
list of VCardString

desc

description.
Type:
list of VCardXString

email

e-mail address(es).
Type:
list of VCardEmail

fn

full name.
Type:
VCardString,

geo

geolocation(s).
Type:
list of VCardGeo

jabberid

JID(s).
Type:
list of VCardJID

key

key(s).
Type:
list of VCardKey

label

address label(s).
Type:
list of VCardLabel

logo

logo(s).
Type:
list of VCardImage

mailer

mailer(s).
Type:
list of VCardString

n

structural name.
Type:
VCardName,

nickname

nickname(s).
Type:
list of VCardString

note

note(s).
Type:
list of VCardString

org

organization(s).
Type:
list of VCardOrg

photo

photo(s).
Type:
list of VCardImage

prodid

product id(s).
Type:
list of VCardString

rev

revision(s).
Type:
list of VCardString

role

role(s).
Type:
list of VCardString

sort-string

sort string(s).
Type:
list of VCardString

sound

sound(s).
Type:
list of VCardSound

tel

phone number(s).
Type:
list of VCardTel

title

title(s).
Type:
list of VCardString

tz

timezone(s).
Type:
list of VCardString

uid

user identifier(s).
Type:
list of VCardString

url

URL(s).
Type:
list of VCardString

Class Variable Details

components

Type:
dict
Value:
{'ADR': (<class pyxmpp.jabber.vcard.VCardAdr at 0x40aaaecc>, 'multi'),
 'AGENT': ('VCardAgent', 'ignore'),
 'BDAY': (<class pyxmpp.jabber.vcard.VCardString at 0x40aaaddc>, 'mult\
i'),
 'CATEGORIES': (<class pyxmpp.jabber.vcard.VCardCategories at 0x40ab70\
2c>,
                'multi'),
 'CLASS': (<class pyxmpp.jabber.vcard.VCardString at 0x40aaaddc>, 'mul\
...                                                                    

xml_element_name

name for the XML element provided by the class.
Type:
unicode
Value:
'query'                                                                

xml_element_namespace

namespace URI for the XML element provided by the class.
Type:
unicode
Value:
'vcard-temp'