Python API for per-plugin configuration/data directory
Description
As far as I know there's no standard for action scripts when they need to generate files, for example configuration file or permanent data files, and have to decide where to put those files.
I guess traditionally the scripts have created those files in the same folder than the script, or maybe in a general user configuration location. This hasn't been a big problem because the end users have been responsible for managing the plugins.
The situation is a bit different with the new content manager. It supports installing and uninstalling plugins. Updating a package to a newer version means uninstalling the old and installing the new. In the process the whole plugin folder is deleted, and the possible generated files in it. The user may loose even important data, or has to reconfigure at the least.
For the sake of consistency I suggest adding python API for getting a configuration/data folder for the plugin. That way the plugin writer wouldn't need to think where to put the files and they could be managed centrally. It would be possible to add a feature to the content manager which asks the user whether to delete or keep the plugin's data folder when the plugin is uninstalled.
This should be of course documented in the python documentation, tutorials, examples etc., otherwise it would be left unused.
KiCad Version
Application: KiCad
Version: (5.99.0-12111-gf59e66a897), release build
Libraries:
wxWidgets 3.0.5
libcurl/7.74.0 OpenSSL/1.1.1j zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh/0.9.5/openssl/zlib nghttp2/1.43.0 librtmp/2.3
Platform: Linux 5.11.0-31-generic x86_64, 64 bit, Little endian, wxGTK, KDE, x11
Build Info:
Date: Aug 29 2021 09:17:11
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.74.0
OCC: 7.5.1
Curl: 7.74.0
ngspice: 34
Compiler: GCC 10.3.0 with C++ ABI 1014
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON