← Back to team overview

kicad-developers team mailing list archive

Re: Fwd: Python plugin for pcbnew

 

> Hi all,
> 
> I need for my job more features on the footprint library management. I
> see on the code that there is a reference
> to "python_footprint_plugin" but it is currently not implemented.
> 
> Is somebody already work on this ? (I don't think so, since I don't
> found any trace on blueprint)
> 
> Is it ok if I start something ?
> 
> Thanks,
> 


Hi  js.reynaud@xxxxxxxxx:

from pcbnew/plugin.cpp

    // Suitable for a C++ to python PLUGIN::Footprint*() adapter, move it to the adapter
    // if and when implemented.
    (*aListToAppendTo)["python_footprint_plugin"] = UTF8( _(
        "Enter the python module which implements the PLUGIN::Footprint*() functions."
        ));


I am not aware of anyone working on this.  Such a *single* C++ adapter was conceived to be
a class PLUGIN gateway into any number of alternative python modules.

The choice of python module is given by the python_footprint_plugin fp_lib_table option.

I suppose the python module is only concerned with the Footprint*() functions within the
PLUGIN API, or a subset thereof, and not PLUGIN::Save() and not PLUGIN::Load() since these
have no role under FP_LIB_TABLE, from which the Option *python_footprint_plugin* comes.

A *subset* of the Footprint*() functions is possible also, as long as your C++ adapter
does not crash but rather sensibly reports the unimplemented python function.

Once you have this working, can you give us a python brain interface, so we can simply
load new footprints by setting fp_lib_table option
python_footprint_plugin=brain_interface, then load whatever footprint we are thinking
about at that moment?


I am still amazed that the dropbox client side support was actually written in python.  I
would have *never* made that choice myself, but its an indication that there are many ways
to do things in the software world.

http://en.wikipedia.org/wiki/Dropbox_%28service%29


Before you spend a lot of time on this *C++ adapter*, make sure you understand the
wxPython footprint wizard capability also, which lets you create new footprints in python
using gui functions of your choosing.







Follow ups

References