[Vobject] Formatting international addresses

martin f krafft madduck at madduck.net
Sun Mar 6 01:55:28 CST 2011


Dear list,

I can get a formatted address from a vcard object like this:

  a = vobject.vcard.Address()
  a.country = 'Switzerland'
  a.code = '8050'
  a.city = 'Zurich'
  a.street = 'Mystreet 1'
  print str(a)
  >> 'Mystreet 1\nZurich,  805\nSwitzerland'

Unfortunately, the output format is that used in the US, not in
Switzerland, where post code would precede city without any
punctuation or double spaces between:

  Mystreet 1\n8050 Zurich\nSwitzerland

The only mail on the matter I found was
http://lists.brotherharris.com/pipermail/vobject/2009-January/000172.html,
but the thread does not provide a solution.

Am I expecting too much functionality from vobject?

Would this functionality make sense in vobject?

Do you know of another class to use to provide this functionality?

Thanks,

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"when I was a boy I was told
 that anybody could become president.
 now i'm beginning to believe it."
                                                    -- clarence darrow
 
spamtraps: madduck.bogus at madduck.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 1124 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)
URL: <http://lists.skyhouseconsulting.com/pipermail/vobject/attachments/20110306/d4855812/attachment.pgp>


More information about the VObject mailing list