From cfa75bb828ef5e0ec2244335cfbada321ab21f77 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 16 Jan 2013 13:38:30 +0100 Subject: [PATCH] Scripting: fix erroneous extension for Sexp board files Make scripting version compilable on platforms where the python executable is not python2 (define it by -DPYTHON_EXECUTABLE=) --- common/dialog_about/AboutDialog_main.cpp | 10 ++++++---- pcbnew/CMakeLists.txt | 2 +- pcbnew/scripting/pcbnew_scripting_helpers.cpp | 18 +++++++++--------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/common/dialog_about/AboutDialog_main.cpp b/common/dialog_about/AboutDialog_main.cpp index e77ba1997f..470e1f5d9a 100644 --- a/common/dialog_about/AboutDialog_main.cpp +++ b/common/dialog_about/AboutDialog_main.cpp @@ -205,7 +205,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) /* The developers */ info.AddDeveloper( new Contributor( wxT( "Jean-Pierre Charras" ), - wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ) ) ); + wxT( "jp.charras@wanadoo.fr" ) ) ); info.AddDeveloper( new Contributor( wxT( "Dick Hollenbeck" ), wxT( "dick@softplc.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Frank Bennett" ), wxT( "bennett78@lpbroadband.net" ) ) ); info.AddDeveloper( new Contributor( wxT( "Hauptmech" ), wxT( "hauptmech@gmail.com" ) ) ); @@ -218,6 +218,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), wxT( "marco.serantoni@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@gmail.com" ) ) ); + info.AddDeveloper( new Contributor( wxT( "Miguel Angel Ajo Pelayo" ), + wxT( "miguelangel@nbee.es" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ), wxT( "rafael.sokolowski@web.de" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) ); @@ -228,7 +230,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) /* The document writers */ info.AddDocWriter( new Contributor( wxT( "Jean-Pierre Charras" ), - wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ) ) ); + wxT( "jp.charras@wanadoo.fr" ) ) ); info.AddDocWriter( new Contributor( wxT( "Igor Plyatov" ), wxT( "plyatov@gmail.com" ) ) ); info.AddDocWriter( new Contributor( wxT( "Fabrizio Tappero" ), @@ -246,7 +248,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) info.AddTranslator( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ), wxT( "Finnish (FI)" ), KiBitmapNew( lang_fi_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Jean-Pierre Charras" ), - wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ), + wxT( "jp.charras@wanadoo.fr" ), wxT( "French (FR)" ), KiBitmapNew( lang_fr_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Mateusz SkowroĊ„ski" ), wxT( "skowri@gmail.com" ), wxT( "Polish (PL)" ), KiBitmapNew( lang_pl_xpm ) ) ); @@ -254,7 +256,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) wxT( "Portuguese (PT)" ), KiBitmapNew( lang_pt_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Igor Plyatov" ), wxT( "plyatov@gmail.com" ), wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) ); - info.AddTranslator( new Contributor( wxT( "Andrey Fedorushkov" ), wxT( "" ), + info.AddTranslator( new Contributor( wxT( "Andrey Fedorushkov" ), wxT( "andrf@mail.ru" ), wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Pedro Martin del Valle" ), wxT( "pkicad@yahoo.es" ), wxT( "Spanish (ES)" ), KiBitmapNew( lang_es_xpm ) ) ); diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 10e29a501c..edb75d85d4 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -442,7 +442,7 @@ endif(WIN32) if(KICAD_SCRIPTING) add_custom_target(FixSwigImportsScripting ALL - ${CMAKE_CURRENT_SOURCE_DIR}/../scripting/fixswigimports.py ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.py + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripting/fixswigimports.py ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.py DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FINAL_EXE} COMMENT "Fixing swig_import_helper in Kicad scripting" ) diff --git a/pcbnew/scripting/pcbnew_scripting_helpers.cpp b/pcbnew/scripting/pcbnew_scripting_helpers.cpp index b6f62364ad..9241c427ca 100644 --- a/pcbnew/scripting/pcbnew_scripting_helpers.cpp +++ b/pcbnew/scripting/pcbnew_scripting_helpers.cpp @@ -43,7 +43,7 @@ static PCB_EDIT_FRAME *PcbEditFrame=NULL; BOARD *GetBoard() { - if (PcbEditFrame) + if (PcbEditFrame) return PcbEditFrame->GetBoard(); else return NULL; } @@ -56,15 +56,15 @@ void ScriptingSetPcbEditFrame( PCB_EDIT_FRAME *aPCBEdaFrame ) BOARD* LoadBoard( wxString& aFileName ) { - if ( aFileName.EndsWith( wxT( ".kicad_brd" ) ) ) + if ( aFileName.EndsWith( wxT( ".kicad_pcb" ) ) ) return LoadBoard(aFileName,IO_MGR::KICAD); - else if (aFileName.EndsWith(wxT(".brd"))) + else if (aFileName.EndsWith(wxT(".brd"))) return LoadBoard(aFileName,IO_MGR::LEGACY); - + // as fall back for any other kind use the legacy format return LoadBoard(aFileName,IO_MGR::LEGACY); - + } BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat ) @@ -86,7 +86,7 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, wxString header; PROPERTIES props; - + if ( aFormat==IO_MGR::LEGACY ) { header = wxString::Format( @@ -95,12 +95,12 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, GetBuildVersion().GetData() ); props["header"] = header; } - - + + IO_MGR::Save( aFormat, aFileName, aBoard, &props ); return true; - + }