← Back to team overview

kicad-developers team mailing list archive

Re: Python support

 

http://pysvn.tigris.org/

The above project is an example of what we are talking about,
something like this architectural stack:

Python + wxPython -> PyCXX -> C++ classes 


In this case the C++ classes are the API onto the subversion client. 
In our case they would have to be all the drawable objects, nets,
pads, texts, lines, tracks, modules, boards, etc.


To be honest, the entire Kicad project could be written using wxPython
and the existing (non-gui) C++ classes and member functions. The
roadmap might entail getting some of the stand-alone (non-member)
functions into their suitable class (i.e. make member functions where
we can from functions which are now not member functions), then wrap
all the C++ classes and their functions in Python objects. 
Significant pieces of the actual gui code over time could migrate to
python. I started some of this by putting the new FindPadOrModule()
function into the the BOARD class instead of into the locate.cpp
source file.


A person could learn a great deal simply by studying the design of
this relatively simple pysvn project. Also, I understand "blender" is
using Python as a scripting language.


As we go, maybe we need a dedicated submenu or combobox where loadable
python "plugins" would be displayed and could be executed from? This
would not limit plugins, but would provide a path of least coding for
python plugins that don't need much more than a "run me" signal.










References