← Back to team overview

kicad-developers team mailing list archive

environment checking in plugins (Re: 5.1.0-rc1)

 

Hello Mitja,

Am 10.02.19 um 08:13 schrieb Mitja Nemec:
> As a plugin developer I agree that KiCad is not responsible for third
> party plugins, but as a developer I don't have any sane option to
> detect the parameters of the system the plugin is running on.

and what exactly you are missing?
Sorry but I've seen the behavior of the plugins again and again that
there is no checking of a working condition at all. All plugins I've
seen are just don't do any checks if they can work meaningful.

> If build flags (especially KICAD_SCRIPTING_WX_PYTHON) would be 
> accessible to python, I (or any plugin developer) could read it 
> before trying to import wx module and could show a meaningful error 
> message using tkinter instead.
That's the way to go.
But KICAD_SCRIPTING_WX_PYTHON isn't enough. You will also need to know
which version of python-wxgtk3.0 is used if KICAD_SCRIPTING_WX_PYTHON is
set. Build time information for python-wxgtk3.0 can be found e.g. in
INSTPATH/wx-3.0-gtk{2,3}/wx/build/build_options.py.
On the most of recent Linux distribution versions it will look like
this. OTOH the current stable releases will show here "toolkit=gtk2".

> $ grep WX_CONFIG  /usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/build/build_options.py
> WX_CONFIG="/usr/bin/wx-config --toolkit=gtk3 --unicode=yes --version=3.0"

I expect that Kicad Python classes can be expanded easily to provide
some built time information of KiCad if they are missing. What kind of
information is needed is probably to discuss.

If plugins can provide some kind of callback function there KiCad can
detect if the plugin is compatible than the plugin can be displayed
grayed out for example in the UI if they are not compatible. And some
more information like version, author ... if the mouse is hovered over
such an entry.

> Should I raise a bug for this wish?

That would be the best as the noise on the list here is rather high.

-- 
Regards
Carsten Schoenert


Follow ups

References