Reply
Thread Tools
Posts: 37 | Thanked: 18 times | Joined on Apr 2010
#21
Code:
/home/user/scripts# python contact_search.py  -f 'Firstname Lastname' -l
Traceback (most recent call last):
  File "contact_search.py", line 55, in <module>
    main()
  File "contact_search.py", line 52, in main
    search_contact(options)
  File "contact_search.py", line 13, in search_contact
    for c in ebook.get_all_contacts():
AttributeError: 'NoneType' object has no attribute 'get_all_contacts'
Am I missing a dependency?
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#22
 

The Following User Says Thank You to nicolai For This Useful Post:
Posts: 37 | Thanked: 18 times | Joined on Apr 2010
#23
"python-evolution is already the newest version"...
Thanks for the quick response though!
 
Posts: 37 | Thanked: 18 times | Joined on Apr 2010
#24
Embarrased now:
Was running as root....
Sorry for wasting your time!
 

The Following User Says Thank You to hutchinsfairy For This Useful Post:
woody14619's Avatar
Posts: 1,455 | Thanked: 3,309 times | Joined on Dec 2009 @ Rochester, NY
#25
Ok, I know this is old, but I have a problem.

I recently added a jabber client to my N900 and it threw about 200 people into the contact list, some of which already had entries, but many didn't. The problem is, I can't find any of the new entries in the list!

I opened one to look at it, and it has only 2 fields in the contact page: The jabber account name, and the Nickname field with their full name. But when I look up the nickname with the python script here, I get no hits. If I edit a user, and just hit save (no changes, just edit/save), it then shows up!

Where are these contacts at? How can I get at them? I'd prefer to modify the script to find people in this "limbo" state (so as new people join in I can get at them), and "fix" their entries, so their names and a proper icon show up. I know how to fix it once there, but can't seem to figure out how to get them.
 
Posts: 129 | Thanked: 32 times | Joined on Jun 2010
#26
is it possible to list all numbers with a matching nickname? i use nickname to get around the missing group sms feature. possible via nicolai script?
 
Posts: 2 | Thanked: 7 times | Joined on Dec 2012
#27
Here's a snippet for adding a contact from the command line:

PHP Code:
#!/usr/bin/env python
#
# Please let me know if this works without python-gnome2 installed!
#

USE='Use: addressbook add_contact given-name=John family-name=Doe email-1=johndoe@example.com'

import os
import sys
import evolution

def quit
message):
    
sys.stderr.write("%s\n"message)
    exit( 
1)

if 
== os.getuid():
    
quit('Not as root please')

adb evolution.ebook.open_addressbook('default')

# Not listing contact because already covered: http://maemo.cloud-7.de/maemo5/usr/local/bin/contact
#def list_contacts( args):
#    for contact in adb.get_all_contacts():
#        print [contact.get_property(ppt) for ppt in ['full-name', 'mobile-phone']]

if lensys.argv) < or sys.argv[1] != 'add_contact':
    
quit( USE)

ct evolution.ebook.EContact()

for 
arg in sys.argv[2:]:
    
namevalue arg.split('=')
    
ct.set_propertynamevalue)

adb.add_contactct
There's also a longer script that can list in YAML and VCARD and add and remove contacts.

Last edited by unclouded; 2012-12-18 at 07:38.
 

The Following User Says Thank You to unclouded For This Useful Post:
Posts: 1 | Thanked: 0 times | Joined on Nov 2013
#28
Hi man, so sorry i was not a programming student. I can't tell you anything related to this.

Locksmith Reading PA
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:30.