30#include <python_scripting.h>
33#include <pybind11/eval.h>
58 std::string pymodule(
"_pcbnew" );
60 if( !SCRIPTING::IsModuleLoaded( pymodule ) )
64 PyImport_AddModule( pymodule.c_str() );
65 PyObject* mod = pcbnew_init();
66 PyObject* sys_mod = PyImport_GetModuleDict();
67 PyDict_SetItemString( sys_mod,
"_pcbnew", mod );
116 frame()->PostSizeEvent();
126 using namespace pybind11::literals;
128 auto locals = pybind11::dict(
129 "sys_path"_a =
TO_UTF8( SCRIPTING::PyScriptingPath( SCRIPTING::PATH_TYPE::STOCK ) ),
130 "user_path"_a =
TO_UTF8( SCRIPTING::PyScriptingPath( SCRIPTING::PATH_TYPE::USER ) ),
131 "third_party_path"_a =
132 TO_UTF8( SCRIPTING::PyPluginsPath( SCRIPTING::PATH_TYPE::THIRDPARTY ) ) );
137pcbnew.LoadPlugins( sys_path, user_path, third_party_path )
139 pybind11::globals(), locals );
145 wxString pluginpath( SCRIPTING::PyPluginsPath( SCRIPTING::PATH_TYPE::USER ) );
Class PCBNEW_ACTION_PLUGINS.
static void UnloadAll()
Unload (deregister) all action plugins.
void ReCreateMenuBar()
Recreates the menu bar.
virtual void ReCreateHToolbar()=0
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
static TOOL_ACTION pluginsShowFolder
static TOOL_ACTION pluginsReload
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.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Implement a participant in the KIWAY alchemy.