[Vobject] Custom Labels

Jeffrey Harris jeffrey at osafoundation.org
Thu Nov 26 14:52:01 CST 2009


Hi Dustin,

> Notice there are some records spanned across multiple lines. Can vobject 
> replicate this? I would like to be able to implement custom labels like so:
> 
> item(n).X-JABBER:jabber at jabber.com
> item(n).X-ABLABEL:MyCompany's Jabber
> 
> Is this currently possible?

Yes, VCARD group labels are supported by vobject.  I've never understood
why this syntax was introduced, since parameters would seem to do the
trick, but you're right, this is what several contact clients expect
(and yes, that syntax is valid VCARD 3.0).

>>> c = vobject.vCard()
>>> foo = c.add('foo')
>>> foo.value = "bar"
>>> foo.group = "grouplabel"
>>> print c.serialize(validate=False)
BEGIN:VCARD
VERSION:3.0
grouplabel.FOO:bar
END:VCARD


Sincerely,
Jeffrey


More information about the VObject mailing list