comparison PyPlugin.cpp @ 66:5664fe298af2

Update to Python 2.7 and clean up the build (avoid using deprecated NumPy API, fix compiler warnings)
author Chris Cannam
date Mon, 17 Nov 2014 09:37:59 +0000
parents c1e4f706ca9a
children 146d14ab15e7
comparison
equal deleted inserted replaced
65:0df94e3f0fdb 66:5664fe298af2
308 FeatureSet rValue; 308 FeatureSet rValue;
309 return genericMethodCall("getRemainingFeatures",rValue); 309 return genericMethodCall("getRemainingFeatures",rValue);
310 } 310 }
311 311
312 bool 312 bool
313 PyPlugin::getBooleanFlag(char flagName[], bool defValue = false) const 313 PyPlugin::getBooleanFlag(const char flagName[], bool defValue = false) const
314 { 314 {
315 bool rValue = defValue; 315 bool rValue = defValue;
316 if (PyObject_HasAttrString(m_pyInstance,flagName)) 316 if (PyObject_HasAttrString(m_pyInstance,flagName))
317 { 317 {
318 PyObject *pyValue = PyObject_GetAttrString(m_pyInstance,flagName); 318 PyObject *pyValue = PyObject_GetAttrString(m_pyInstance,flagName);
331 if (m_debugFlag) cerr << FLAG_VALUE << endl; 331 if (m_debugFlag) cerr << FLAG_VALUE << endl;
332 return rValue; 332 return rValue;
333 } 333 }
334 334
335 int 335 int
336 PyPlugin::getBinaryFlags(char flagName[], eVampyFlags defValue = vf_NULL) const 336 PyPlugin::getBinaryFlags(const char flagName[], eVampyFlags defValue = vf_NULL) const
337 { 337 {
338 int rValue = defValue; 338 int rValue = defValue;
339 if (PyObject_HasAttrString(m_pyInstance,flagName)) 339 if (PyObject_HasAttrString(m_pyInstance,flagName))
340 { 340 {
341 PyObject *pyValue = PyObject_GetAttrString(m_pyInstance,flagName); 341 PyObject *pyValue = PyObject_GetAttrString(m_pyInstance,flagName);
427 m_processFailure = true; 427 m_processFailure = true;
428 } 428 }
429 } 429 }
430 430
431 void 431 void
432 PyPlugin::typeErrorHandler(char *method, bool process) const 432 PyPlugin::typeErrorHandler(const char *method, bool process) const
433 { 433 {
434 bool strict = false; 434 bool strict = false;
435 while (m_ti.error) { 435 while (m_ti.error) {
436 PyTypeInterface::ValueError e = m_ti.getError(); 436 PyTypeInterface::ValueError e = m_ti.getError();
437 #ifdef HAVE_NUMPY 437 #ifdef HAVE_NUMPY