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 )
/* 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( "<andrf@mail.ru>" ),
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 ) ) );
......
......@@ -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"
)
......
......@@ -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;
}
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