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
evocontacts.vcf
Traceback (most recent call last):
  File "../import", line 32, in <module>
    getAddressBook().addContact(vcard)
  File "../import", line 17, in getAddressBook
    sb = dbus.SessionBus()
  File "/usr/lib/python2.5/site-packages/dbus/_dbus.py", line 217, in
__new__
    mainloop=mainloop)
  File "/usr/lib/python2.5/site-packages/dbus/_dbus.py", line 106, in
__new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib/python2.5/site-packages/dbus/bus.py", line 125, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException:
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.

Brian




More information about the community mailing list