pcbnew scripting: fixed for coding style policy

This commit is contained in:
Miguel Angel Ajo 2012-07-31 23:00:33 +02:00
parent f96d557e73
commit 474128a445
7 changed files with 176 additions and 179 deletions

View File

@ -50,9 +50,6 @@ void FOOTPRINT_WIZARDS::register_wizard(FOOTPRINT_WIZARD *aWizard)
wxString name = aWizard->GetName(); wxString name = aWizard->GetName();
m_FootprintWizards.push_back( aWizard ); m_FootprintWizards.push_back( aWizard );
//printf("Registered footprint wizard '%s'\n",(const char*)name.mb_str() );
} }

View File

@ -451,7 +451,6 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList()
} }
m_ParameterGrid->SetCellValue( i, 1 , value ); m_ParameterGrid->SetCellValue( i, 1 , value );
m_ParameterGrid->SetCellValue( i, 2 , units ); m_ParameterGrid->SetCellValue( i, 2 , units );
m_ParameterGrid->SetReadOnly( i, 2 ); m_ParameterGrid->SetReadOnly( i, 2 );
} }
@ -734,6 +733,7 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateHToolbar()
_( "Insert footprint in board" ) ); _( "Insert footprint in board" ) );
} }
#endif #endif
// after adding the buttons to the toolbar, must call Realize() to // after adding the buttons to the toolbar, must call Realize() to
// reflect the changes // reflect the changes
m_mainToolBar->Realize(); m_mainToolBar->Realize();
@ -745,4 +745,5 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateHToolbar()
void FOOTPRINT_WIZARD_FRAME::ReCreateVToolbar() void FOOTPRINT_WIZARD_FRAME::ReCreateVToolbar()
{ {
} }

View File

@ -51,7 +51,8 @@ PyObject* PYTHON_FOOTPRINT_WIZARD::CallMethod(const char* aMethod, PyObject *aAr
printf( "method not found, or not callable: %s\n", aMethod ); printf( "method not found, or not callable: %s\n", aMethod );
} }
if (pFunc) Py_XDECREF(pFunc); if ( pFunc )
Py_XDECREF( pFunc );
return NULL; return NULL;
} }
@ -134,7 +135,8 @@ int PYTHON_FOOTPRINT_WIZARD::GetNumParameterPages()
if (result) if (result)
{ {
if (!PyInt_Check(result)) return -1; if ( !PyInt_Check( result ) )
return -1;
ret = PyInt_AsLong( result ); ret = PyInt_AsLong( result );
Py_DECREF( result ); Py_DECREF( result );
} }
@ -260,8 +262,6 @@ wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues(int aPage,wxArrayString& aV
wxString res = CallRetStrMethod( "SetParameterValues", arglist ); wxString res = CallRetStrMethod( "SetParameterValues", arglist );
Py_DECREF( arglist ); Py_DECREF( arglist );
return res; return res;
} }
@ -272,10 +272,12 @@ MODULE *PYTHON_FOOTPRINT_WIZARD::GetModule()
{ {
PyObject *result, *obj; PyObject *result, *obj;
result = CallMethod( "GetModule", NULL ); result = CallMethod( "GetModule", NULL );
if (!result) return NULL;
if (!result)
return NULL;
obj = PyObject_GetAttrString( result, "this" ); obj = PyObject_GetAttrString( result, "this" );
if (PyErr_Occurred()) if (PyErr_Occurred())
{ {
/* /*
@ -288,7 +290,6 @@ MODULE *PYTHON_FOOTPRINT_WIZARD::GetModule()
PyErr_Print(); PyErr_Print();
} }
return PyModule_to_MODULE(obj); return PyModule_to_MODULE(obj);
} }
@ -308,7 +309,6 @@ void PYTHON_FOOTPRINT_WIZARDS::register_wizard(PyObject* aPyWizard)
fw->register_wizard(); fw->register_wizard();
#if 0 #if 0
/* just to test if it works correctly */ /* just to test if it works correctly */
int pages = fw->GetNumParameterPages(); int pages = fw->GetNumParameterPages();
@ -321,9 +321,6 @@ void PYTHON_FOOTPRINT_WIZARDS::register_wizard(PyObject* aPyWizard)
} }
#endif #endif
} }

View File

@ -43,7 +43,8 @@ static PCB_EDIT_FRAME *PcbEditFrame=NULL;
BOARD *GetBoard() BOARD *GetBoard()
{ {
if (PcbEditFrame) return PcbEditFrame->GetBoard(); if (PcbEditFrame)
return PcbEditFrame->GetBoard();
else return NULL; else return NULL;
} }
@ -57,6 +58,7 @@ BOARD* LoadBoard(wxString& aFileName)
if ( aFileName.EndsWith( wxT( ".kicad_brd" ) ) ) if ( aFileName.EndsWith( wxT( ".kicad_brd" ) ) )
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);
@ -68,7 +70,6 @@ BOARD* LoadBoard(wxString& aFileName)
BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat ) BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat )
{ {
return IO_MGR::Load( aFormat, aFileName ); return IO_MGR::Load( aFormat, aFileName );
} }
bool SaveBoard( wxString& aFilename, BOARD* aBoard ) bool SaveBoard( wxString& aFilename, BOARD* aBoard )

View File

@ -14,6 +14,7 @@ BOARD *GetBoard();
BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat ); BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat );
BOARD* LoadBoard( wxString& aFileName ); BOARD* LoadBoard( wxString& aFileName );
bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat ); bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat );
bool SaveBoard( wxString& aFileName, BOARD* aBoard ); bool SaveBoard( wxString& aFileName, BOARD* aBoard );