|
KiCad PCB EDA Suite
|
#include <python_manager.h>
Public Member Functions | |
| PYTHON_MANAGER (const wxString &aInterpreterPath) | |
| long | Execute (const std::vector< wxString > &aArgs, const std::function< void(int, const wxString &, const wxString &)> &aCallback, const wxExecuteEnv *aEnv=nullptr, bool aSaveOutput=false) |
| Launches the Python interpreter with the given arguments. | |
| long | ExecuteSync (const std::vector< wxString > &aArgs, wxString *aStdout=nullptr, wxString *aStderr=nullptr, const wxExecuteEnv *aEnv=nullptr) |
| wxString | GetInterpreterPath () const |
| void | SetInterpreterPath (const wxString &aPath) |
Static Public Member Functions | |
| static wxString | FindPythonInterpreter () |
| Searches for a Python intepreter on the user's system. | |
| static std::optional< wxString > | GetPythonEnvironment (const wxString &aNamespace) |
| static std::optional< wxString > | GetVirtualPython (const wxString &aNamespace) |
| Returns a full path to the python binary in a venv, if it exists. | |
Private Attributes | |
| wxString | m_interpreterPath |
Definition at line 32 of file python_manager.h.
| PYTHON_MANAGER::PYTHON_MANAGER | ( | const wxString & | aInterpreterPath | ) |
Definition at line 85 of file python_manager.cpp.
References FN_NORMALIZE_FLAGS, m_interpreterPath, and path.
| long PYTHON_MANAGER::Execute | ( | const std::vector< wxString > & | aArgs, |
| const std::function< void(int, const wxString &, const wxString &)> & | aCallback, | ||
| const wxExecuteEnv * | aEnv = nullptr, | ||
| bool | aSaveOutput = false ) |
Launches the Python interpreter with the given arguments.
| aArgs | |
| aCallback | |
| aEnv | |
| aSaveOutput |
Definition at line 93 of file python_manager.cpp.
References _, GetKiCadThreadPool(), m_interpreterPath, process, tp, and traceApi.
Referenced by API_PLUGIN_MANAGER::doInvokeAction(), API_PLUGIN_MANAGER::processNextJob(), and PANEL_PLUGIN_SETTINGS::validatePythonInterpreter().
| long PYTHON_MANAGER::ExecuteSync | ( | const std::vector< wxString > & | aArgs, |
| wxString * | aStdout = nullptr, | ||
| wxString * | aStderr = nullptr, | ||
| const wxExecuteEnv * | aEnv = nullptr ) |
Definition at line 183 of file python_manager.cpp.
References m_interpreterPath, and traceApi.
Referenced by API_PLUGIN_MANAGER::doInvokeAction().
|
static |
Searches for a Python intepreter on the user's system.
Definition at line 215 of file python_manager.cpp.
References FindKicadFile(), and output.
Referenced by PGM_BASE::InitPgm(), and PANEL_PLUGIN_SETTINGS::OnBtnDetectAutomaticallyClicked().
|
inline |
Definition at line 54 of file python_manager.h.
References m_interpreterPath.
|
static |
Definition at line 263 of file python_manager.cpp.
References PATHS::EnsurePathExists(), PATHS::GetUserCachePath(), and path.
Referenced by API_PLUGIN_MANAGER::doInvokeAction(), GetVirtualPython(), API_PLUGIN_MANAGER::processNextJob(), API_PLUGIN_MANAGER::processPluginDependencies(), and API_PLUGIN_MANAGER::RecreatePluginEnvironment().
|
static |
Returns a full path to the python binary in a venv, if it exists.
Definition at line 276 of file python_manager.cpp.
References GetPythonEnvironment().
Referenced by API_PLUGIN_MANAGER::doInvokeAction(), and API_PLUGIN_MANAGER::processNextJob().
|
inline |
Definition at line 55 of file python_manager.h.
References m_interpreterPath.
|
private |
Definition at line 69 of file python_manager.h.
Referenced by Execute(), ExecuteSync(), GetInterpreterPath(), PYTHON_MANAGER(), and SetInterpreterPath().