Re: [Evolution-hackers] Accessing EDS in Python



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*"
> 


Also, as pointed out by Milan on irc, your code is missing a call to
open_sync().

Though you might consider making everything async.

Cheers,
Raul 



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