From 27301996f4dc63b085b577c023b498c87e7f6af1 Mon Sep 17 00:00:00 2001 From: Mario Hros Date: Sat, 7 Apr 2018 19:06:48 +0200 Subject: [PATCH] don't copy python shell when wxWidget support is disabled --- pcbnew/CMakeLists.txt | 10 ++++++---- pcbnew/pcb_edit_frame.cpp | 2 ++ pcbnew/swig/python_scripting.cpp | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 7a49a7fef..dfed6380e 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -746,10 +746,12 @@ if( KICAD_SCRIPTING ) ) # python shell - install( DIRECTORY ${PROJECT_SOURCE_DIR}/pcbnew/python/kicad_pyshell/ - DESTINATION ${KICAD_DATA}/scripting/kicad_pyshell - FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ - ) + if ( KICAD_SCRIPTING_WXPYTHON ) + install( DIRECTORY ${PROJECT_SOURCE_DIR}/pcbnew/python/kicad_pyshell/ + DESTINATION ${KICAD_DATA}/scripting/kicad_pyshell + FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ + ) + endif() endif() diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 10f27f63b..30b614f10 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1172,6 +1172,8 @@ void PCB_EDIT_FRAME::ScriptingConsoleEnableDisable( wxCommandEvent& aEvent ) wxWindow * pythonPanelFrame = findPythonConsole(); bool pythonPanelShown = true; + printf("k3a: still trying to CreatePythonShellWindow %d\n", KICAD_SCRIPTING_WXPYTHON); + if( pythonPanelFrame == NULL ) pythonPanelFrame = CreatePythonShellWindow( this, pythonConsoleNameId() ); else diff --git a/pcbnew/swig/python_scripting.cpp b/pcbnew/swig/python_scripting.cpp index 2fd02bc12..2a838c2a4 100644 --- a/pcbnew/swig/python_scripting.cpp +++ b/pcbnew/swig/python_scripting.cpp @@ -146,6 +146,8 @@ bool pcbnewInitPythonScripting( const char * aUserScriptingPath ) Py_Initialize(); + printf("k3a: just intit test..\n"); + #ifdef KICAD_SCRIPTING_WXPYTHON PyEval_InitThreads(); @@ -294,6 +296,8 @@ void RedirectStdio() wxWindow* CreatePythonShellWindow( wxWindow* parent, const wxString& aFramenameId ) { + printf("k3a: I am in CreatePythonShellWindow %d\n", KICAD_SCRIPTING_WXPYTHON); + const char* pcbnew_pyshell = "import kicad_pyshell\n" "\n" -- 2.16.3