← Back to team overview

kicad-developers team mailing list archive

Re: Current state of ActionPlugin

 

Should this option be added to the about box->copy version info for
completeness?

On Tue, Jan 17, 2017 at 8:08 AM, Jean-Samuel Reynaud
<js.reynaud@xxxxxxxxx> wrote:
> Hi all,
>
> Please find attached the patch for the action plugin menu.
>
> There is a build option to enable/disable this feature:
> KICAD_SCRIPTING_ACTION_MENU
> => It's disabled by default
>
> Now there is a refresh button. It took new plugins, update existing ...
> like in footprint wizard dialog.
>
> I had remove the example from the patch as asked.
>
> Regards,
> Le 11/01/2017 à 18:58, jp charras a écrit :
>> Le 11/01/2017 à 17:36, Jean-Samuel Reynaud a écrit :
>>>>> Pay a particular attention to the fact plugins can be *now* updated (when the source file has
>>>>> changed), and therefore menus can also be updated.
>>>>> the "PCB_EDIT_FRAME::createActionPluginMenus()" method calls Connect, but Disconnect is never called
>>>>> by destructors.
>>>>> It can create issues when updating scripts, because it could be called more than once.
>>>>
>>>> If you need to update the menus when a script file changes, you would
>>>> have to connect a wxFileWatcherEvent to the appropriate wxMainFrame
>>>> object to monitor the loaded script file and update the menus
>>>> accordingly.  It can be done but I would proceed with caution here.
>>>>
>>> Is it really necessary to add a file watcher ? Once python plugins are
>>> loaded, python subsystem run the plugin as it was at start time (As I
>>> understand).
>>> I had perform a little test for that. If you modify a plugin while
>>> pcbnew is running, this is always the "old" version that is running. Not
>>> sure that is true for all OS...
>>
>> I am thinking you are talking only about tests on footprint wizards.
>>
>> On Windows, the newer is reloaded (as long as you run onUpdatePythonModulesClick).
>> This is easy to see if the description string in the footprint plugin is modified.
>>
>>> So menu are not supposed to change even if file change.
>>> An other point: if I implement that file watching, I should also
>>> implement a "directory watcher". In case a new plugins is installed
>>> during pcbnew is running ;)
>>> Perhaps an "update button": like onUpdatePythonModulesClick for
>>> footprint plugins ?
>>
>> From my experience when debugging a footprint wizard module:
>> An "update button" is certainly enough: it is mainly for python script developers when they are
>> writing and debugging a python script, not for an user who just uses a script.
>> An automatic update is not useful, and perhaps not good.
>>
>> The update button was asked since a long time, and I perfectly understand this wish.
>> (The old way was: closing and rerun kicad)
>> It is intended to reload python modules during their development.
>>
>> Remark: onUpdatePythonModulesClick updates all loaded python modules.
>> Of course only python modules which are newer than the currently loaded are reloaded.
>> Therefore onUpdatePythonModulesClick will also update the action plugins.
>>
>
>
> _______________________________________________
> 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