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 if(
Pgm().GetCommonSettings()->m_Api.enable_server )
117 Pgm().GetPluginManager().ReloadPlugins();
123 frame()->ReCreateMenuBar();
125 frame()->ReCreateHToolbar();
127 frame()->PostSizeEvent();
137 using namespace pybind11::literals;
139 auto locals = pybind11::dict(
140 "sys_path"_a =
TO_UTF8( SCRIPTING::PyScriptingPath( SCRIPTING::PATH_TYPE::STOCK ) ),
141 "user_path"_a =
TO_UTF8( SCRIPTING::PyScriptingPath( SCRIPTING::PATH_TYPE::USER ) ),
142 "third_party_path"_a =
143 TO_UTF8( SCRIPTING::PyPluginsPath( SCRIPTING::PATH_TYPE::THIRDPARTY ) ) );
148pcbnew.LoadPlugins( sys_path, user_path, third_party_path )
150 pybind11::globals(), locals );
156 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)