31#include <python_scripting.h>
34#include <pybind11/eval.h>
63 std::string pymodule(
"_pcbnew" );
65 if( !SCRIPTING::IsModuleLoaded( pymodule ) )
69 PyImport_AddModule( pymodule.c_str() );
70 PyObject* mod = pcbnew_init();
71 PyObject* sys_mod = PyImport_GetModuleDict();
72 PyDict_SetItemString( sys_mod,
"_pcbnew", mod );
116 Pgm().GetPluginManager().ReloadPlugins();
122 frame()->ReCreateMenuBar();
124 frame()->ReCreateHToolbar();
126 frame()->PostSizeEvent();
136 using namespace pybind11::literals;
138 auto locals = pybind11::dict(
139 "sys_path"_a =
TO_UTF8( SCRIPTING::PyScriptingPath( SCRIPTING::PATH_TYPE::STOCK ) ),
140 "user_path"_a =
TO_UTF8( SCRIPTING::PyScriptingPath( SCRIPTING::PATH_TYPE::USER ) ),
141 "third_party_path"_a =
142 TO_UTF8( SCRIPTING::PyPluginsPath( SCRIPTING::PATH_TYPE::THIRDPARTY ) ) );
147pcbnew.LoadPlugins( sys_path, user_path, third_party_path )
149 pybind11::globals(), locals );
155 wxString pluginpath( SCRIPTING::PyPluginsPath( SCRIPTING::PATH_TYPE::USER ) );
Class PCBNEW_ACTION_PLUGINS.
static TOOL_ACTION pluginsReload
static void UnloadAll()
Unload (deregister) all action plugins.
static TOOL_ACTION pluginsShowFolder
Scripting Actions.
@ KIFACE_SCRIPTING_LEGACY
bool LaunchExternal(const wxString &aPath)
Launches the given file or folder in the host OS.
This file contains miscellaneous commonly used macros and functions.
PGM_BASE & Pgm()
The global Program "get" accessor.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Implement a participant in the KIWAY alchemy.
IFACE KIFACE_BASE kiface("pcb_test_frame", KIWAY::FACE_PCB)