Commit 968a0c92 authored by jean-pierre charras's avatar jean-pierre charras

Scripting: fix erroneous extension for S exp board files, which prevent to...

Scripting: fix erroneous extension for S exp board files, which prevent to open a .kicad_pcb file from a python script
Make scripting version compilable on platforms where the python executable is not python2:
Just define it by -DPYTHON_EXECUTABLE=<python executable filename> when running cmake (there was already a partial fix for this)
parents de78b60d cfa75bb8
...@@ -205,7 +205,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -205,7 +205,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
/* The developers */ /* The developers */
info.AddDeveloper( new Contributor( wxT( "Jean-Pierre Charras" ), 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( "Dick Hollenbeck" ), wxT( "dick@softplc.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Frank Bennett" ), wxT( "bennett78@lpbroadband.net" ) ) ); info.AddDeveloper( new Contributor( wxT( "Frank Bennett" ), wxT( "bennett78@lpbroadband.net" ) ) );
info.AddDeveloper( new Contributor( wxT( "Hauptmech" ), wxT( "hauptmech@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Hauptmech" ), wxT( "hauptmech@gmail.com" ) ) );
...@@ -218,6 +218,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -218,6 +218,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ),
wxT( "marco.serantoni@gmail.com" ) ) ); wxT( "marco.serantoni@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@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" ), info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ),
wxT( "rafael.sokolowski@web.de" ) ) ); wxT( "rafael.sokolowski@web.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) );
...@@ -228,7 +230,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -228,7 +230,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
/* The document writers */ /* The document writers */
info.AddDocWriter( new Contributor( wxT( "Jean-Pierre Charras" ), 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" ), info.AddDocWriter( new Contributor( wxT( "Igor Plyatov" ),
wxT( "plyatov@gmail.com" ) ) ); wxT( "plyatov@gmail.com" ) ) );
info.AddDocWriter( new Contributor( wxT( "Fabrizio Tappero" ), info.AddDocWriter( new Contributor( wxT( "Fabrizio Tappero" ),
...@@ -246,7 +248,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -246,7 +248,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
info.AddTranslator( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ), info.AddTranslator( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ),
wxT( "Finnish (FI)" ), KiBitmapNew( lang_fi_xpm ) ) ); wxT( "Finnish (FI)" ), KiBitmapNew( lang_fi_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Jean-Pierre Charras" ), 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 ) ) ); wxT( "French (FR)" ), KiBitmapNew( lang_fr_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Mateusz Skowroński" ), wxT( "skowri@gmail.com" ), info.AddTranslator( new Contributor( wxT( "Mateusz Skowroński" ), wxT( "skowri@gmail.com" ),
wxT( "Polish (PL)" ), KiBitmapNew( lang_pl_xpm ) ) ); wxT( "Polish (PL)" ), KiBitmapNew( lang_pl_xpm ) ) );
...@@ -254,7 +256,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -254,7 +256,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
wxT( "Portuguese (PT)" ), KiBitmapNew( lang_pt_xpm ) ) ); wxT( "Portuguese (PT)" ), KiBitmapNew( lang_pt_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Igor Plyatov" ), wxT( "plyatov@gmail.com" ), info.AddTranslator( new Contributor( wxT( "Igor Plyatov" ), wxT( "plyatov@gmail.com" ),
wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) ); wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Andrey Fedorushkov" ), wxT( "<andrf@mail.ru>" ), info.AddTranslator( new Contributor( wxT( "Andrey Fedorushkov" ), wxT( "andrf@mail.ru" ),
wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) ); wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Pedro Martin del Valle" ), wxT( "pkicad@yahoo.es" ), info.AddTranslator( new Contributor( wxT( "Pedro Martin del Valle" ), wxT( "pkicad@yahoo.es" ),
wxT( "Spanish (ES)" ), KiBitmapNew( lang_es_xpm ) ) ); wxT( "Spanish (ES)" ), KiBitmapNew( lang_es_xpm ) ) );
......
...@@ -442,7 +442,7 @@ endif(WIN32) ...@@ -442,7 +442,7 @@ endif(WIN32)
if(KICAD_SCRIPTING) if(KICAD_SCRIPTING)
add_custom_target(FixSwigImportsScripting ALL 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} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FINAL_EXE}
COMMENT "Fixing swig_import_helper in Kicad scripting" COMMENT "Fixing swig_import_helper in Kicad scripting"
) )
......
...@@ -43,7 +43,7 @@ static PCB_EDIT_FRAME *PcbEditFrame=NULL; ...@@ -43,7 +43,7 @@ static PCB_EDIT_FRAME *PcbEditFrame=NULL;
BOARD *GetBoard() BOARD *GetBoard()
{ {
if (PcbEditFrame) if (PcbEditFrame)
return PcbEditFrame->GetBoard(); return PcbEditFrame->GetBoard();
else return NULL; else return NULL;
} }
...@@ -56,15 +56,15 @@ void ScriptingSetPcbEditFrame( PCB_EDIT_FRAME *aPCBEdaFrame ) ...@@ -56,15 +56,15 @@ void ScriptingSetPcbEditFrame( PCB_EDIT_FRAME *aPCBEdaFrame )
BOARD* LoadBoard( wxString& aFileName ) BOARD* LoadBoard( wxString& aFileName )
{ {
if ( aFileName.EndsWith( wxT( ".kicad_brd" ) ) ) if ( aFileName.EndsWith( wxT( ".kicad_pcb" ) ) )
return LoadBoard(aFileName,IO_MGR::KICAD); return LoadBoard(aFileName,IO_MGR::KICAD);
else if (aFileName.EndsWith(wxT(".brd"))) else if (aFileName.EndsWith(wxT(".brd")))
return LoadBoard(aFileName,IO_MGR::LEGACY); return LoadBoard(aFileName,IO_MGR::LEGACY);
// as fall back for any other kind use the legacy format // as fall back for any other kind use the legacy format
return LoadBoard(aFileName,IO_MGR::LEGACY); return LoadBoard(aFileName,IO_MGR::LEGACY);
} }
BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat ) BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat )
...@@ -86,7 +86,7 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, ...@@ -86,7 +86,7 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard,
wxString header; wxString header;
PROPERTIES props; PROPERTIES props;
if ( aFormat==IO_MGR::LEGACY ) if ( aFormat==IO_MGR::LEGACY )
{ {
header = wxString::Format( header = wxString::Format(
...@@ -95,12 +95,12 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, ...@@ -95,12 +95,12 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard,
GetBuildVersion().GetData() ); GetBuildVersion().GetData() );
props["header"] = header; props["header"] = header;
} }
IO_MGR::Save( aFormat, aFileName, aBoard, &props ); IO_MGR::Save( aFormat, aFileName, aBoard, &props );
return true; return true;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment