On Sun, 2011-07-24 at 21:42 +0200, David Klasinc wrote:
> Greetings,
> I am trying to do a simple search in the address book, this is the code 
> that refuses to work:
> #!/usr/bin/python
> from gi.repository import EBook
> contacts = []
> # Initialize client and open it
> client = EBook.BookClient.new_system()
> # Set the query
> query_string = "(contains \"full_name\" \"N\")"
> print "Look for:", query_string
> # Get some contacts!
> ret = EBook.BookClient.get_contacts_sync(client, query_string, contacts, 
> None)
> print contacts
> if not ret:
>    print "*sob*"
> List contacts is always empty and upon running I get the assertion error:
> (process:5032): libebook-CRITICAL **: e_book_client_get_contacts_sync: 
> assertion `contacts != NULL' failed

A couple of things, get_contacts_sync is an instance method so should
just do:


Also, the e_book_client_get_contacts_sync() is badly annotated so the 
Contacts out param is not being picked up by gobject-introspection. I am
pushing a fix for that now. 

Finally, asking around in #gobject-introspection, out params aren't used
as such by pygobject but they are returned to yoy. So in this case
you'll end up having to call (once you get a corrected GIR file for

ret, contacts = client.get_contacts_sync(query_string, None)


evolution-hackers mailing list
To change your list options or unsubscribe, visit ...

Reply via email to