← Back to team overview

kicad-developers team mailing list archive

Re: Current state of ActionPlugin

 

Frankly I don't think we should be encouraging users to use the Python API
until it is significantly improved. The issues JP raises make the API
completely unsuitable for plugin use. It's opaque and no users have any
idea how to write robust Python plugins given the current state of the API.

On Jan 10, 2017 09:55, "jp charras" <jp.charras@xxxxxxxxxx> wrote:

Le 10/01/2017 à 15:18, Maciej Sumiński a écrit :
> Hi Jean-Samuel,
>
> I think your patch will facilitate use of 3rd party python plugins, as
> the current way of executing commands from the Python shell is not quite
> user friendly. I vote for merging the patch, but we need to fix some
> code formatting issues first.
>
> Also, I wonder if it would be the right thing to group menu entries by
> their categories to create submenus. It could be a simple way to
> organize the actions provided by python plugins. Just an idea.
>
> Another question is about the following lines:
> +        if( IsGalCanvasActive() )
> +        {
> +            UseGalCanvas( GetGalCanvas() );
> +        }
>
> What is exactly the goal here? If it is only about refreshing the
> canvas, then a simple Refresh() call should fix the problem.
>
> Regards,
> Orson
>

This is a good work.
Thanks Jean-Samuel.

However, before merging we have to take care of issues which can easily
crash Pcbnew:
Because a python script can modify the board outside the control of pcbnew
edit functions, I am
thinking problems will arise with undo/redo lists (invalid pointers),
ratsnest data and certainly a
few other things.

Especially for scripts which add or delete items, or change connectivity.

Of course, undo/redo lists are alway incorrect after running such scripts.
This is already a known issue for scripts that are run from the Pcbnew
python console.

--
Jean-Pierre CHARRAS

_______________________________________________
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

Follow ups

References