kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #15611
Re: Footprint python plugin: Is it possible to merge ?
On 11/5/2014 3:26 PM, jp charras wrote:
> 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.
>
I had a chance to look at this. It built and ran fine but I am confused
about it's purpose. It looks to me like a Python wrapper for PCB_IO
rather than a generic Python footprint library/board file plugin.
PCB_IO is already wrapped by swig as part of the python scripting. You
should be able do the same thing by doing the following in a Python script:
import _pcbnew
pcbio = new_PCB_IO()
_pcbnew.PCB_IO.FootprintEnumerate( pcbio, "path/to/footprint/library" )
_pcbnew.PCB_IO.FootprintLoad( pcbio, "name_of_footprint_to_load" )
...
It would make more sense to me if the plugin was derived from PLUGIN and
allowed you use Python to parse footprint libraries from other EDAs that
we currently don't support such as Altium or Orcad. I'm trying to see
what this code would give us that we don't already have unless the swig
wrapped PCB_IO class does not work correctly. If that's the case,
wouldn't it be better to fix the swig wrapper of PCB_IO? I'm going to
need some convincing as to why this should be included in kicad.
If you do convince me, I would like to ask that you implement the Load
and Save functions just in case someone would want to load and/or save a
board file and not just the footprint libraries.
References