Re: [Evolution-hackers] Accessing EDS in Python



On Thu, 2011-07-28 at 13:33 +0100, Raul Gutierrez Segales wrote:
> Also, as pointed out by Milan on irc, your code is missing a call to
> open_sync().

Yeah, that was left out while copy/pasting.

> Though you might consider making everything async.

I'll think about this when I have the basics going on. :) Anyway the
current updated source:

#!/usr/bin/python
from gi.repository import EBook

contacts = []

client = EBook.BookClient.new_system()
ret = client.open_sync(client, None)        # ???
if not ret:
  print "*sob*"

query_string = "(contains \"full_name\" \"a\")"
ret, contacts = client.get_contacts_sync(query_string, None)

print contacts

if not ret:
  print "*sob*"

Results in a number of warnings and python segfaulting.

** (process:13555): WARNING **:
(/build/buildd/pygobject-2.28.6/gi/pygi-argument.c:1349):_pygi_argument_to_object: runtime check failed: (transfer == GI_TRANSFER_NOTHING)

This is returned for every hit in the database. So I am guessing
something goes wrong when trying to access contents of the list that is
returned.

Rgrds,
David





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]