|
2010-03-25
, 09:14
|
Posts: 15 |
Thanked: 4 times |
Joined on Mar 2010
|
#12
|
|
2010-03-25
, 10:07
|
|
Posts: 288 |
Thanked: 113 times |
Joined on Dec 2009
@ Germany
|
#13
|
Idea is to look how Hermes does it. I've browsed their source code yesterday.. looks they use "proper" way of accessing contacts..
Btw: there should be some new external python lib for accessing contacts in more object oriented way.. Hermes does it somehow, I will somehow, you will somehow.. each of us on its own..
Should be some common public code for that...
|
2010-03-26
, 10:17
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#14
|
|
2010-03-26
, 10:40
|
|
Posts: 288 |
Thanked: 113 times |
Joined on Dec 2009
@ Germany
|
#15
|
I dont know if this is a fault in python-evolution, have you tried to use
libebook from c rather then from python. It looks like, that this
way to get multiple mobile-phone numbers (get contact, get contact properties ...)
wouldnt work even there. I dont know, just a guess.
However, you can create vcard string from your contacts
(with "contact[x].get_vcard_string()")
and parse this string for "TEL;TYPE=HOME" or "TEL;TYPE=CELL".
This is an easy way to get all phone numbers.
nicolai
|
2010-03-31
, 18:06
|
Posts: 200 |
Thanked: 300 times |
Joined on Nov 2009
@ The Netherlands
|
#16
|
I've found the reason...
=username
I log with different username, though the same UID as 'user'
That's the reason. Library can't find /home/*/.osso/*
When logged as 'user' I get proper results
|
2010-03-31
, 23:16
|
Posts: 15 |
Thanked: 4 times |
Joined on Mar 2010
|
#17
|
Is there a way to make it also run as root?
I'm using this Python code as part of a cgi-bin script on my website on my N900.
But a cgi-bin script under lighttpd is run as root so it won't work...
cd /home/your-custom-user/ ln -s /home/user/.osso-abook/ cd /root/ ln -s /home/user/.osso-abook/ ipython ....
The Following User Says Thank You to nthx For This Useful Post: | ||
|
2010-04-01
, 11:39
|
Posts: 200 |
Thanked: 300 times |
Joined on Nov 2009
@ The Netherlands
|
#18
|
|
2010-04-14
, 00:07
|
Posts: 15 |
Thanked: 4 times |
Joined on Mar 2010
|
#19
|
#ebook = evolution.ebook.open_addressbook("default") #self.econtact == abook.get_all_contacts()[x] def get_vcard(self): if not self.vcard: self.vcard = vobject.readOne(self.econtact.get_vcard_string()) return self.vcard def phones_from_vobject_slow(self): #vcard parsing implementation: SLOW for line in self.get_vcard().lines(): if 'TEL' == line.name and line.value: yield line.value def phones_from_ctypes(self): #initial implementation... not returning all phones.. for phone_attr in ContactsAPI.phone_attributes: phone = self.econtact.get_property(phone_attr) if phone: yield phone
|
2010-04-14
, 00:24
|
|
Posts: 288 |
Thanked: 113 times |
Joined on Dec 2009
@ Germany
|
#20
|
wow man ... :-/ vobject->vcard parsing is so slooooww
I get like 10x slower in parsing vcard.
When parsing 500 contacts it makes an 11 seconds difference vs 1sec when parsing contacts using "econtact.get_property()..."
But at least it looks more reliable, cause it returns ALL phones...
it's time to cache sth.. :/
I run your code on my Contact and all I get is
So IMHO ist should look like:
So either there is something wrong with the mapping or we ar doing something terribly wrong.
Second there is nothing like 'mobile-home'
I am going nuts there is no documentation about the available attributes used in the addressbook and no docu about the attributes available to "python-evolution".
I guess the only way to get a serious list of numbers is via ctypes, but I would rather like to avoid this. *grrrr*
Any ideas?
Cheers
Bjoern
My website:
- olausson.de
- gallery.olausson.de
My Applications: