← Back to team overview

kicad-developers team mailing list archive

Re: Footprint python plugin: Is it possible to merge ?

 

Le 04/11/2014 12:40, Jean-Samuel Reynaud a écrit :
> Hi,
> 
> Anyway, this gateway plugin for custom plugin writen in python is ready
> (for me).
> So my initial question is about the possibility to integrate it in main
> branch (merge) ?
> 

Jean-Samuel,

Thanks for your work, it is promising.

I tested it, and I found some issues.
There are not blocking issues, but these issues need to be fixed.

In the attached file, my remarks.

I tested your work only on Windows, because I am thinking you are using
Linux, and tested it on Linux.

May I ask you to write a documentation about python plug-in usage,
otherwise be sure it will never used, and your work useless, if this doc
does not exist.
(I mean python plug-in purpose, some documented samples step by step,
Know-how ...
Do not expect few comment lines in fppython_example.py is enough:
they helped me, but they are *not* enough)

Still, thanks, really thanks.

-- 
Jean-Pierre CHARRAS
Tested on Windows with build options:
BUILD_FPPYTHON_PLUGIN=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=OFF
KICAD_SCRIPTING_WXPYTHON=OFF

Compil issue:
fppython.cpp must include "wx_python_helpers.h" (due to use of wx2PyString())

Link issue: Cvpcb need to be linked with wx_python_helper (for the same reason)

Because fppython and wx_python_helper are used both by Pcbnew and Cvpcb,
perhaps they should be part of pcbcommon library

Example issue:
fppython_example.py shows 2 footprints.
But this is the same footprint which is created, therefore when trying this
example, users could think there is a bug.

Usage issues:

to use a python plugin, the python plugin path must be defined by option:
python_footprint_plugin_path
but this option does not exist in fp lib table editor.

fppython_plugin.cpp needs enhancements:
Currently there are serious constraints to define a python plugin name:

*if we want to use the plugin file fppython_example.py,
the python_footprint_plugin option must be "fppython_example",
and using "fppython_example.py" does not work, which is not usual, when
a filename is expected.
*On windows, the not documented python_footprint_plugin_path option
uses a non usual notation:
a path like c:\myproject\myplugins must be entered as:
c:\\myproject\\myplugins


This is not good:
1 - because a local fp lib table is not compatible between
Linux/OSX and Windows.
2 - because this notation is not the native windows nottaion.

I am thinking a full plugin filename (in unix or windows notation)
should be accepted by the python_footprint_plugin option,
and should accept environment variables notation,
like the fp table filenames.

Therefore, fppython_plugin.cpp must parse the python_footprint_plugin option
and format python parameters to fix difference between systems (unix, windows),
and format python string commands, from usual full file names format.

An other thing is the fact we need a document to explain how to use python lib plugins,
and omre example ( at least a sample which uses the ffotprint lib filename parameter )

Follow ups

References