[maemo-developers] [maemo-developers] Re: Python bindings anyone?

From: Brad Clements bkc at murkworks.com
Date: Thu Jun 9 01:29:44 EEST 2005
On 6 Jun 2005 at 14:06, Marius Vollmer wrote:

> > I wonder if anyone on this list ist working on Python bindings for
> > Hildon / LibOSSO / D-Bus?
> 
> Yes, I am.  I have a basic package with bindings for HildonApp and
> HildonAppView working, and a little bit of HildonFileChooser.  Some work
> might be needed on hildon and libosso itself to make it completely and
> painlessly wrap-able.  Please talk to me when you have suggestions in
> that direction.
> 
> Also, I am grateful for any hints on how to do Python bindings the Right
> Way.  Right now, I am just blindly imitating pygtk... see the attached
> tarball.

I've just had time to take a look at your .tar file. (Thanks!)

I haven't compiled it yet, just looked at the .py files.

With respect to your wish to be "more Pythonic":

I think it's clearer to stick to the serial, procedural method you've employed 
in the code. Yes, you could do fancy callback bindings using lambda, 
properties and what-not, but I think that could obscure the essential 
message you're trying to propogate through simple examples.

I worry that folks would get caught up trying to figure out (possibly) meta 
classes, decorators and what-not, making it more difficult to see the clear 
examples of how to use the hildon specific interfaces.


"making gtk more python friendly", is probably not the job of hildon 
examples.

--

Just my opinion.

I do have one more comment. It might be helpful if you stuck to the "python 
style guide"

http://www.python.org/doc/essays/styleguide.html

The one thing I note is you put spaces before the left-paren, which looks 
odd to me. I think other "hard-core" Python users will probably be used to 
following "Guido's style guide" as well.

I realize this is a personal style issue.  I wouldn't stress over it, I'm just very 
pleased to see this code!


-- 
Brad Clements,                bkc at murkworks.com    (315)268-1000
http://www.murkworks.com                          
AOL-IM or SKYPE: BKClements

We must come down from our heights, and leave our straight 
paths, for the byways and low places of life, if we would 
learn truths by strong contrasts; and in hovels, in forecastles, 
and among our own outcasts in foreign lands, see what has been 
wrought upon our fellow-creatures by accident, hardship, or vice. 
- Richard Henry Dana, Jr. 1836


More information about the maemo-developers mailing list