Reply
Thread Tools
Posts: 5 | Thanked: 0 times | Joined on Dec 2009
#1
Hello there.

I'm a really a newbie in Python and maemo development, so sorry in advance for my silly questions.

I've studied the tutorial about GUI...really impressive, but now I want to go forward and I'd like to learn how to use binding modules...

I've found on pymaemo web site some examples about abook, the python module that is used to access address book.

In these examples ther's an

Code:
impot abook
statement.

when I try to launch it...an error message is displayed like this:

ImportError: No module named abook

On the device I've installed the pymaemo env and I'm using Pluthon on windows platform (I've tried also ESbox from Ubuntu...and evenmore...directly onto the device with pyGTKEditor).

Any clue?
Thank you very much to all.
 
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#2
Originally Posted by falkontre View Post
I've found on pymaemo web site some examples about abook, the python module that is used to access address book.
Unfortunately, libabook has no Python bindings on Fremantle at the moment.

There are two alternatives:
  1. python-evolution can give you access to the local Evolution database part of the address book.
  2. Use ctypes to talk directly to libabook.

Both have advantages and disadvantages, and both are used in Hermes, see contacts.py and hermes.py for examples:

https://git.maemo.org/projects/herme...;f=package/src
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 

The Following User Says Thank You to Jaffa For This Useful Post:
Posts: 5 | Thanked: 0 times | Joined on Dec 2009
#3
Thank you very much for your answer.

I've read on the

http://pymaemo.garage.maemo.org/development.html

that exists a binding (version 0.1) for fremantle....maybe this info confused me.

I've already looked source code of Hermes, and in contact.py the author used abook as import statement...it's a different thing?

I'm so confused, sorry
 
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#4
Originally Posted by falkontre View Post
http://pymaemo.garage.maemo.org/development.html - that exists a binding (version 0.1) for fremantle....maybe this info confused me.
Oooh, exciting. That's new; I dunno if they've released it yet.

I've already looked source code of Hermes, and in contact.py the author[...]
...that's me :-)...

[...]used abook as import statement
Not that I can see. I was wrong, it doesn't use abook at the moment (it did in an earlier version). contacts.py uses ctypes to access the low-level C API of libebook (i.e. Evolution), due to limitations in python-evolution.

Whereas, hermes.py uses the "proper" Python API: python-evolution.

Sorry for any confusion. Anyway, you can access libabook via ctypes; I've done it in earlier versions of Hermes; but it's not very Pythonic.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 

The Following 2 Users Say Thank You to Jaffa For This Useful Post:
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#5
Strange. There seem to be plenty of examples using abook, but nothing that explains which package abook is in.
__________________
aspidites | blog | aspidites@inbox.com
 
Posts: 5 | Thanked: 0 times | Joined on Dec 2009
#6
Oh...let me say that your Hermes sounds very good...

so we've to check if that binding has been released yet.

I was trying an approach without using C language because I'm a little afraid with it...I studied it a bit at college, but I became a Java fan with passing of time

Python is simpler for me (despite I never used it before today )

I'll use some of your tips to improve my maemo development experience.

Thank you for all.
 
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#7
I'm a Java guy professionally, and Python is currently the best high-level OO language bet for Maemo and isn't dead-end when Qt comes along.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 
Posts: 77 | Thanked: 52 times | Joined on Sep 2009 @ US
#8
When asked about this I was told that abook is for Maemo 4.x versions (even though this page http://pymaemo.garage.maemo.org/development.html incorrectly lists that API for Maemo 5). For now use ctypes (or check how Hermes does it :-)

Hartti
 
Posts: 5 | Thanked: 0 times | Joined on Dec 2009
#9
thank you for this info hartti...now that I know that no abook exist for fremantle,i'll concentrate on the use of ctypes.

Do you know if (and when) will be released it?

thank you
 
Posts: 53 | Thanked: 90 times | Joined on Nov 2009 @ Manaus, Brazil
#10
Originally Posted by hartti View Post
When asked about this I was told that abook is for Maemo 4.x versions (even though this page http://pymaemo.garage.maemo.org/development.html incorrectly lists that API for Maemo 5). For now use ctypes (or check how Hermes does it :-)
Exactly. That page was incorrect and, as part of a website reorganization, we moved the components descriptions to the wiki: http://wiki.maemo.org/PyMaemo/Components

Unfortunately I forgot to remove the old page as part of this. The link above now points to http://pymaemo.garage.maemo.org/docs.html.
__________________
Anderson Lizardo
 
Reply


 
Forum Jump


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