From: Dan F. <tem...@ya...> - 2005-05-02 18:35:25
|
Hi lcd4linux team! I've been talking to Michael regarding a python plugin to your cool application. I already got a dynamic layout manager written in python but it is a bit intrusive to the rest of the C-code, so we will be starting off with a simpler python plugin. On Mon, 2005-05-02 at 16:33 +0200, Michael Reinelt wrote: > Hi Dan, > > I've added you to the developer list. Please set up your CVS. If you > need any assistance, please let me know. > Thanx, i got cvs up and running now. As for the first step of the python integration.... I've updated your plugin_python.c file in such a way that it: - has a small footprint (nothing else is changed in the source code) - is independent of the lcd4linux_wrapper* - can operate even when main() is in C - (probably) can co-exist with lcd4linux_wrapper (not tested)* - can execute any global python function that takes a string in and returns a string *lcd4linux_wrapper.c=whatever_name_we_decide.c I also cleaned up the example python code a bit. To make python_plugin.c compile and link i had to add: DEFS+=$(PYTHON_CPPFLAGS) LIBS+=$(PYTHON_EXTRA_LIBS) to the Makefile I also had to: export PYTHONPATH=. in order to make the lcd4linux executable find the python code. When things stabilises a bit i will write a install script that will put that piece of code under /usr/lib/pythonX.X/site-packages where python searches by default. I have not checked in anything of this, I'm just sending you the bits of code you need to do a peer-review of the code. I think that's it. Oh, one more thing. This is an example of what you can put in your lcd4linux.conf to make it all work.. Widget PythonNetDev { class 'Text' expression python::exec('lcd4linuxplugins', 'getNetDev', 'eth0') prefix 'eth0: ' width 23 align 'R' update tick } don't forget the "export PYTHONPATH=." when testing directly from build directory :) /Dan |