← Back to team overview

kicad-developers team mailing list archive

Re: Pcbnew Python Interface breakage?

 

Something doesn't seem right in module.i.  This line:

    def GetPluginForPath(lpath):
        return IO_MGR.PluginFind(IO_MGR.LEGACY)

in the %pyhton section would suggest that the only plugin available to
this code is the legacy plugin.  Why would you not want get any valid
plugin type?  This seems unnecessarily limited.

I don't think it will be a quick fix.  Solving the FootprintEnumerate()
issue will most likely require some C++ coding to directly call the
plugin FootprintEnumerate() method in the pcbnew library and convert the
wxArrayString contents into a python string list.

On 6/27/2017 11:03 AM, Kaspar Emanuel wrote:
> I am just looking at writing a fix at
> https://github.com/KiCad/kicad-source-mirror/blob/37f8c83c5bc5e8a61cc25d69de569dee7eea0e9f/pcbnew/swig/module.i#L69
> 
> If you can see a quick fix you could probably save me a lot of time as I
> am planning on getting my KiCad build set up again and submitting a patch.
> 
> On 27 June 2017 at 15:59, Maciej Sumiński <maciej.suminski@xxxxxxx
> <mailto:maciej.suminski@xxxxxxx>> wrote:
> 
>     On 06/27/2017 04:49 PM, Kaspar Emanuel wrote:
>     > On 27 June 2017 at 07:56, Maciej Sumiński <maciej.suminski@xxxxxxx
>     <mailto:maciej.suminski@xxxxxxx>> wrote:
>     >
>     > PLUGIN::FootprintEnumerate() signature has changed [1] and now instead
>     >> of returning wxArrayString, it takes one as a reference and fills
>     it out.
>     >>
>     > Thanks Orson, looks like Python bindings for that function are
>     currently
>     > broken then. I think I can use the binding for
>     PLUGIN::FootprintLoad for my
>     > purposes though it doesn’t throw any sensible exceptions when it can’t
>     > parse a footprint.
> 
>     I am afraid such breaks may happen more often. We still do not have well
>     defined Python interface providing an abstraction layer to C++ code and
>     it is hard to develop new features without modifying interfaces from
>     time to time.
> 
>     I have fixed the methods reported by Maurice and Simon because they were
>     declared in SWIG files, so I consider them a part of the official Python
>     interface (perhaps incorrectly).
> 
>     Regards,
>     Orson
> 
> 
>     _______________________________________________
>     Mailing list: https://launchpad.net/~kicad-developers
>     <https://launchpad.net/~kicad-developers>
>     Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     Unsubscribe : https://launchpad.net/~kicad-developers
>     <https://launchpad.net/~kicad-developers>
>     More help   : https://help.launchpad.net/ListHelp
>     <https://help.launchpad.net/ListHelp>
> 
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


References