Import Contacts

Brian C brianwc at OCF.Berkeley.EDU
Fri Jul 11 18:18:14 CEST 2008

Al Johnson wrote:
> Thanks Phil. I tweaked it to get it to work with more than one contact per 
> file as exported by my K700i. It should work as before if there's just one 
> contact per file. Here's the modified bit.
> for name in names:
>   print name
>   vcard = ""
>   f=open(name,'r')
>   for line in f:
>    vcard = vcard + line
>    if line[:9] == "END:VCARD":
>      getAddressBook().addContact(vcard)
>      vcard = ""
I'm using Al's modification to Phil's import script and get the
following error.  Anyone understand and can explain how to fix?

root at om-gta02:/media/card/Contacts/abook# python ../import
Traceback (most recent call last):
  File "../import", line 32, in <module>
  File "../import", line 17, in getAddressBook
    sb = dbus.SessionBus()
  File "/usr/lib/python2.5/site-packages/dbus/", line 217, in
  File "/usr/lib/python2.5/site-packages/dbus/", line 106, in
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib/python2.5/site-packages/dbus/", line 125, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to
autolaunch D-Bus session: Autolaunch requested, but X11 support not
compiled in.
Cannot continue.

I called the script "import" and it resides in the /media/card/Contacts
folder and I put my evocontacts.vcf in the /media/card/Contacts/abook
directory.  It is the export of around 611 contacts from Evolution.
Thanks for any suggestions.


More information about the community mailing list