Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Python - Access Abook

    Reply
    falkontre | # 1 | 2010-01-07, 22:20 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jaffa | # 2 | 2010-01-07, 23:09 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Jaffa For This Useful Post:
    iKneaDough

     
    falkontre | # 3 | 2010-01-07, 23:31 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jaffa | # 4 | 2010-01-07, 23:50 | Report

    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.

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

    Originally Posted by
    [...]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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Jaffa For This Useful Post:
    bruno.araujo, falkontre

     
    aspidites | # 5 | 2010-01-08, 00:06 | Report

    Strange. There seem to be plenty of examples using abook, but nothing that explains which package abook is in.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    falkontre | # 6 | 2010-01-08, 00:11 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jaffa | # 7 | 2010-01-08, 13:16 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    hartti | # 8 | 2010-01-11, 17:00 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    falkontre | # 9 | 2010-01-11, 17:52 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    lizardo | # 10 | 2010-01-11, 19:34 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
vBulletin® Version 3.8.8
Normal Logout