← Back to team overview

kicad-developers team mailing list archive

Re: more pythonic scripting API for pcbnew

 

On Wed, Jan 7, 2015 at 11:35 PM, Miguel Ángel Ajo <majopela@xxxxxxxxxx>
wrote:

> Whoops :-), %s/LordBlick/PTT/g
>
> Miguel Ángel Ajo
>
> On Wednesday, 7 de January de 2015 at 23:31, LordBlick wrote:
>
> In response to a message written on 07.01.2015, 23:07, from Miguel Ángel
> Ajo:
>
> Hi Lordblick, sorry, I was on a run before, and I actually didn’t look
> into your code, but stepped into tabs vs spaces (thinking it was a
> discussion
> about in-KiCad code).
>
> Your python extra layer is very nice, actually, at the start I was very
> reluctant
> on adding another layer and reusing the C++ interface as much as possible,
> and, even if that’s cheaper, it has a lot of disadvantages:
>
> 1) Resulting code is not very pythonic, and hard to read.
>
> 2) If C++ implementation changes, the available python scripts break.
>
> 3) The auto generated documentation is poor, if we had a python mid-layer,
> we could have very nice documentation rendered by sphinx or any equivalent
> pythonic solution.
>
> I must say, that it sounds like an interesting step, and quite motivating,
> if other people wanted to join forces on this, and discuss about what would
> be an ideal interface (your implementation seems like a very nice start
> point
> to start discusion), I’d love to spend some time on it and re-join forces
> back
> to KiCad development.
>
> Regardless that I'm different person than PTT, I think that some of most
> useful
> code pieces (in example LayerSet with modified by me get_layer()) could be
> included in swig staff…
>
> --
> Best Regards,
> LordBlick
>
>
> Good to see the discussion getting on. Indeed this is just a starting
point, not a completely thought through API :)
Thanks for the suggestions, it's updated again.
Putting it on the path would be good enough, so it can be loaded without
hassle. But including parts in the swig layer is good too.

One thing I like to add is a redraw screen function, but I couldn't find
it, anyone knows? (now you have to move the canvas to see the changes)

regards,
Piers

References