KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew_scripting.cpp File Reference

methods to add scripting capabilities inside pcbnew More...

#include <python_scripting.h>
#include <cstdlib>
#include <cstring>
#include <Python.h>
#include <sstream>
#include <eda_base_frame.h>
#include <gal/color4d.h>
#include <trace_helpers.h>
#include <string_utils.h>
#include <macros.h>
#include <paths.h>
#include <settings/settings_manager.h>
#include <kiplatform/environment.h>
#include <wx/app.h>
#include <config.h>

Go to the source code of this file.

Functions

static void pcbnewRunPythonMethodWithReturnedString (const char *aMethodName, wxString &aNames)
 Run a python method from the pcbnew module.
 
void pcbnewGetUnloadableScriptNames (wxString &aNames)
 Collect the list of python scripts which could not be loaded.
 
void pcbnewGetScriptsSearchPaths (wxString &aNames)
 Collect the list of paths where python scripts are searched.
 
void pcbnewGetWizardsBackTrace (wxString &aTrace)
 Return the backtrace of errors (if any) when wizard python scripts are loaded.
 

Detailed Description

methods to add scripting capabilities inside pcbnew

Definition in file pcbnew_scripting.cpp.

Function Documentation

◆ pcbnewGetScriptsSearchPaths()

void pcbnewGetScriptsSearchPaths ( wxString &  aNames)

Collect the list of paths where python scripts are searched.

Parameters
aNamesis a wxString which will contain the paths (separated by '
')

Definition at line 130 of file pcbnew_scripting.cpp.

References pcbnewRunPythonMethodWithReturnedString().

Referenced by DIALOG_FOOTPRINT_WIZARD_LIST::initLists().

◆ pcbnewGetUnloadableScriptNames()

void pcbnewGetUnloadableScriptNames ( wxString &  aNames)

Collect the list of python scripts which could not be loaded.

Parameters
aNamesis a wxString which will contain the filenames (separated by '
')

Definition at line 124 of file pcbnew_scripting.cpp.

References pcbnewRunPythonMethodWithReturnedString().

Referenced by DIALOG_FOOTPRINT_WIZARD_LIST::initLists().

◆ pcbnewGetWizardsBackTrace()

void pcbnewGetWizardsBackTrace ( wxString &  aNames)

Return the backtrace of errors (if any) when wizard python scripts are loaded.

Parameters
aNamesis a wxString which will contain the trace

Definition at line 136 of file pcbnew_scripting.cpp.

References pcbnewRunPythonMethodWithReturnedString(), and wxStringSplit().

Referenced by PANEL_PCBNEW_ACTION_PLUGINS::OnShowErrorsButtonClick(), DIALOG_FOOTPRINT_WIZARD_LIST::onShowTrace(), and PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow().

◆ pcbnewRunPythonMethodWithReturnedString()

static void pcbnewRunPythonMethodWithReturnedString ( const char *  aMethodName,
wxString &  aNames 
)
static

Run a python method from the pcbnew module.

Parameters
aMethodNameis the name of the method (like "pcbnew.myfunction" ).
aNameswill contain the returned string.

Definition at line 58 of file pcbnew_scripting.cpp.

References From_UTF8().

Referenced by pcbnewGetScriptsSearchPaths(), pcbnewGetUnloadableScriptNames(), and pcbnewGetWizardsBackTrace().