Fso Python binding

Michele Renda michele.renda at gmail.com
Mon Feb 16 02:22:14 CET 2009


Hello to all

I am writing here to show something I was working today, and I'd like to
know your opinions.
I try to explain with a few of words. How someone of you know, I wrote
Sephora. In lastest day I lost some time to trying to fix sephora with
the new fso milestone. Where I was working I realized that I hate dbus
:) Ok, I know it is very important, it is cross language compatibile,
but I program in python, and I don't like to write too much code. If I
want to turn on a led I want to do something like:

device = ODeviced()
device.getLED().getGta02AuxRed().setBlinking(2, 3)

Or if I want to react to a function I want to do something like this:

gps = OGpsd()
def myfunc(i):
     # I do something here
gps.connect('fixStatusChanged', myfunc)

So, I studied a bit how to use reflection in Python and the source code
written by Michael Lauer, and I wrote a Python binding for FSO, and I
called with a lot of fantasy PyFso (It is only a transitory name,
because I think this name is already used for another project).

You can have a look here: [1]

To help the navigation, it also print the structure of the object I
created [2].

For now it is only a proof of concept. I would like to know if someone
else have the same feeling with dbus.

Thank you
Michele Renda

[1] http://dl.getdropbox.com/u/562269/PyFso/pyfso.py
[2] /home/michele/Dropbox/Public/PyFso/structure.txt








More information about the community mailing list