[Vobject] phone numbers

Jeffrey Harris jeffrey at osafoundation.org
Mon Dec 1 11:42:15 CST 2008


Hi Doc,

> 1. How to create types such as VOICE,MSG,WORK.
> 
> If I do:
>   card.tel.type_param = "HOME"
> then I get a correct single-valued type; but if I do:
>   card.tel.type_param = "HOME;VOICE"
> then when I serialize the card, the type contains extraneous quotation marks:
>   TEL;TYPE="HOME,VOICE":303-530-1598

Hmm, I think the semicolon stays a semicolon, doesn't it?

In any case, what you're looking for is:

card.tel.type_paramlist = ['HOME', 'VOICE']

> 2. How to have multiple phone numbers in the card (each with a different
> type and value, of course).

card.add('tel')

will create another tel contentline for you.

You can access the full list for a given name, rather than just the
first, using, for instance:

card.tel_list

> As I mentioned in my earlier post, I haven't been able to find the
> documentation for vobject (except for what's on the web site, which is
> insufficient to guess at how to perform things like this -- at least for
> me, anyway).

Have you read the usage examples?

http://vobject.skyhouseconsulting.com/usage.html

I don't make any claims that that page is complete documentation, but it
does mention both of the above details.

Sincerely,
Jeffrey


More information about the VObject mailing list