← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Fix wrong directory building for python plugins


Le 23/06/2017 à 21:52, Jean-Samuel Reynaud a écrit :
>> In fact it is existing actually since user's home ".kicad_plugins" directory was build in a bad
>> way (string contact with tailing "/" instead of os.path.join) 
> s/contact/concat/ ;)

This is the case only on Linux, and only for guys who add this subdir in their home directory.
Therefore not when installing Kicad from distributions.

I committed your patch, and added the handling of broken python scripts in subdirs, and handling of
non python subdir (like subdirs containing .xsl files only)

Please test it.

I had issues because I tested your patch (that was not broken) on a Window install, having subdirs
in <kicad>\share\kicad\scripting\plugins.
All scripts are working, but all scripts are not python scripts.
These subdirs have subdirs and contain also .xsl scripts.

I am still thinking the current way to handle pythons scripts in subdirs is really broken because:
- subdirs in subdirs are not handled: this is a heavy limitation.
- subdirs containing .xsl scripts are not smartly handled
- the need to add and configure __init__.py in subdir is for now a workaround, but not really
acceptable for most of users, who just copy pythons scripts in a suitable subdir (the natural way to
add and manage pythons scripts)

I'll be really happy if someone could have a look into this loading mechanism, and find a better way
to load python scripts (Remember I have a poor knowledge of Python).


Jean-Pierre CHARRAS

Follow ups