Commit 742e1a7e authored by Miguel Angel Ajo's avatar Miguel Angel Ajo

Reverted back the ( i ) parameters for python, applied the PyGILState_Ensure...

Reverted back the ( i ) parameters for python, applied the PyGILState_Ensure from Dick into his PyLOCK class
parent 93a8e7b3
......@@ -171,7 +171,7 @@ wxString PYTHON_FOOTPRINT_WIZARD::GetParameterPageName( int aPage )
PyLOCK lock;
// Time to call the callback
PyObject* arglist = Py_BuildValue( "( i )", aPage );
PyObject* arglist = Py_BuildValue( "(i)", aPage );
PyObject* result = CallMethod( "GetParameterPageName", arglist );
Py_DECREF( arglist );
......@@ -191,7 +191,7 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterNames( int aPage )
wxArrayString ret;
PyLOCK lock;
PyObject* arglist = Py_BuildValue( "( i )", aPage );
PyObject* arglist = Py_BuildValue( "(i)", aPage );
ret = CallRetArrayStrMethod( "GetParameterNames", arglist );
Py_DECREF( arglist );
......@@ -214,7 +214,7 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterTypes( int aPage )
wxArrayString ret;
PyLOCK lock;
PyObject* arglist = Py_BuildValue( "( i )", aPage );
PyObject* arglist = Py_BuildValue( "(i)", aPage );
ret = CallRetArrayStrMethod( "GetParameterNames", arglist );
Py_DECREF( arglist );
......@@ -240,7 +240,7 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterValues( int aPage )
{
PyLOCK lock;
PyObject* arglist = Py_BuildValue( "( i )", aPage );
PyObject* arglist = Py_BuildValue( "(i)", aPage );
wxArrayString ret = CallRetArrayStrMethod( "GetParameterValues", arglist );
......@@ -253,7 +253,7 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterErrors( int aPage )
{
PyLOCK lock;
PyObject* arglist = Py_BuildValue( "( i )", aPage );
PyObject* arglist = Py_BuildValue( "(i)", aPage );
wxArrayString ret = CallRetArrayStrMethod( "GetParameterErrors", arglist );
Py_DECREF( arglist );
......@@ -279,7 +279,7 @@ wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues( int aPage, wxArrayString&
PyObject* arglist;
arglist = Py_BuildValue( "( i,O )", aPage, py_list );
arglist = Py_BuildValue( "(i,O)", aPage, py_list );
wxString res = CallRetStrMethod( "SetParameterValues", arglist );
Py_DECREF( arglist );
......
......@@ -78,7 +78,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE, wxEmptyString, KiBitmap( new_footprint_xpm ),
_( "New module" ) );
#ifdef KICAD_SCRIPTING_WXPYTHON
#ifdef KICAD_SCRIPTING
m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE_FROM_WIZARD, wxEmptyString,
KiBitmap( module_wizard_xpm ),
_( "New module from footprint wizard" ) );
......
......@@ -44,14 +44,13 @@ public:
#else
class PyLOCK
{
PyGILState_STATE gil_state;
public:
// @todo: this is wrong, python docs clearly say we need the GIL,
// irrespective of wxPython.
PyLOCK() {}
~PyLOCK() {}
PyLOCK() { gil_state = PyGILState_Ensure(); }
~PyLOCK() { PyGILState_Release( gil_state ); }
};
#endif
......
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