Fix braces
This commit is contained in:
parent
6ac444f587
commit
ce471ec898
|
@ -110,11 +110,14 @@ wxString PYTHON_ACTION_PLUGIN::CallRetStrMethod( const char* aMethod, PyObject*
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
const char* str_res = NULL;
|
const char* str_res = NULL;
|
||||||
PyObject* temp_bytes = PyUnicode_AsEncodedString( result, "UTF-8", "strict" );
|
PyObject* temp_bytes = PyUnicode_AsEncodedString( result, "UTF-8", "strict" );
|
||||||
if ( temp_bytes != NULL ) {
|
if ( temp_bytes != NULL )
|
||||||
|
{
|
||||||
str_res = PyBytes_AS_STRING( temp_bytes );
|
str_res = PyBytes_AS_STRING( temp_bytes );
|
||||||
str_res = strdup( str_res );
|
str_res = strdup( str_res );
|
||||||
Py_DECREF( temp_bytes );
|
Py_DECREF( temp_bytes );
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
wxLogMessage( "cannot encode unicode python string" );
|
wxLogMessage( "cannot encode unicode python string" );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -99,7 +99,8 @@ wxString PYTHON_FOOTPRINT_WIZARD::CallRetStrMethod( const char* aMethod, PyObjec
|
||||||
|
|
||||||
PyObject* result = CallMethod( aMethod, aArglist );
|
PyObject* result = CallMethod( aMethod, aArglist );
|
||||||
|
|
||||||
if ( result == Py_None ) {
|
if ( result == Py_None )
|
||||||
|
{
|
||||||
Py_DECREF( result );
|
Py_DECREF( result );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -109,11 +110,14 @@ wxString PYTHON_FOOTPRINT_WIZARD::CallRetStrMethod( const char* aMethod, PyObjec
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
const char* str_res = NULL;
|
const char* str_res = NULL;
|
||||||
PyObject* temp_bytes = PyUnicode_AsEncodedString( result, "UTF-8", "strict" );
|
PyObject* temp_bytes = PyUnicode_AsEncodedString( result, "UTF-8", "strict" );
|
||||||
if ( temp_bytes != NULL ) {
|
if ( temp_bytes != NULL )
|
||||||
|
{
|
||||||
str_res = PyBytes_AS_STRING( temp_bytes );
|
str_res = PyBytes_AS_STRING( temp_bytes );
|
||||||
str_res = strdup( str_res );
|
str_res = strdup( str_res );
|
||||||
Py_DECREF( temp_bytes );
|
Py_DECREF( temp_bytes );
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
wxLogMessage( "cannot encode unicode python string" );
|
wxLogMessage( "cannot encode unicode python string" );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -219,7 +223,8 @@ wxString PYTHON_FOOTPRINT_WIZARD::GetParameterPageName( int aPage )
|
||||||
|
|
||||||
Py_DECREF( arglist );
|
Py_DECREF( arglist );
|
||||||
|
|
||||||
if ( result == Py_None ) {
|
if ( result == Py_None )
|
||||||
|
{
|
||||||
Py_DECREF( result );
|
Py_DECREF( result );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -229,11 +234,14 @@ wxString PYTHON_FOOTPRINT_WIZARD::GetParameterPageName( int aPage )
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
const char* str_res = NULL;
|
const char* str_res = NULL;
|
||||||
PyObject* temp_bytes = PyUnicode_AsEncodedString( result, "UTF-8", "strict" );
|
PyObject* temp_bytes = PyUnicode_AsEncodedString( result, "UTF-8", "strict" );
|
||||||
if ( temp_bytes != NULL ) {
|
if ( temp_bytes != NULL )
|
||||||
|
{
|
||||||
str_res = PyBytes_AS_STRING( temp_bytes );
|
str_res = PyBytes_AS_STRING( temp_bytes );
|
||||||
str_res = strdup( str_res );
|
str_res = strdup( str_res );
|
||||||
Py_DECREF( temp_bytes );
|
Py_DECREF( temp_bytes );
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
wxLogMessage( "cannot encode unicode python string" );
|
wxLogMessage( "cannot encode unicode python string" );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -250,13 +250,17 @@ static void pcbnewRunPythonMethodWithReturnedString( const char* aMethodName, wx
|
||||||
PyObject* str = PyDict_GetItemString(localDict, "result" );
|
PyObject* str = PyDict_GetItemString(localDict, "result" );
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
const char* str_res = NULL;
|
const char* str_res = NULL;
|
||||||
if(str) {
|
if(str)
|
||||||
|
{
|
||||||
PyObject* temp_bytes = PyUnicode_AsEncodedString( str, "UTF-8", "strict" );
|
PyObject* temp_bytes = PyUnicode_AsEncodedString( str, "UTF-8", "strict" );
|
||||||
if ( temp_bytes != NULL ) {
|
if ( temp_bytes != NULL )
|
||||||
|
{
|
||||||
str_res = PyBytes_AS_STRING( temp_bytes );
|
str_res = PyBytes_AS_STRING( temp_bytes );
|
||||||
str_res = strdup( str_res );
|
str_res = strdup( str_res );
|
||||||
Py_DECREF( temp_bytes );
|
Py_DECREF( temp_bytes );
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
wxLogMessage( "cannot encode unicode python string" );
|
wxLogMessage( "cannot encode unicode python string" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -422,12 +426,15 @@ wxArrayString PyArrayStringToWx( PyObject* aArrayString )
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
const char* str_res = NULL;
|
const char* str_res = NULL;
|
||||||
PyObject* temp_bytes = PyUnicode_AsEncodedString( element, "UTF-8", "strict" );
|
PyObject* temp_bytes = PyUnicode_AsEncodedString( element, "UTF-8", "strict" );
|
||||||
if ( temp_bytes != NULL ) {
|
if ( temp_bytes != NULL )
|
||||||
|
{
|
||||||
str_res = PyBytes_AS_STRING( temp_bytes );
|
str_res = PyBytes_AS_STRING( temp_bytes );
|
||||||
str_res = strdup( str_res );
|
str_res = strdup( str_res );
|
||||||
Py_DECREF( temp_bytes );
|
Py_DECREF( temp_bytes );
|
||||||
ret.Add( FROM_UTF8( str_res ), 1 );
|
ret.Add( FROM_UTF8( str_res ), 1 );
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
wxLogMessage( "cannot encode unicode python string" );
|
wxLogMessage( "cannot encode unicode python string" );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -454,7 +461,8 @@ wxString PyErrStringWithTraceback()
|
||||||
PyErr_Fetch( &type, &value, &traceback );
|
PyErr_Fetch( &type, &value, &traceback );
|
||||||
|
|
||||||
PyErr_NormalizeException( &type, &value, &traceback );
|
PyErr_NormalizeException( &type, &value, &traceback );
|
||||||
if ( traceback == NULL ) {
|
if ( traceback == NULL )
|
||||||
|
{
|
||||||
traceback = Py_None;
|
traceback = Py_None;
|
||||||
Py_INCREF( traceback );
|
Py_INCREF( traceback );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue