Commit 4d373203 authored by Julien Osman's avatar Julien Osman Committed by Cédric Traizet

ENH: Release Python's GIL during execution

parent 92e0b671
......@@ -19,7 +19,7 @@
*/
%module otbApplication
%module("threads"=1) otbApplication
%{
#include "itkBase.includes"
......@@ -260,22 +260,22 @@ public:
#if SWIGPYTHON
Logger* GetLogger();
#endif
unsigned long itk::Object::AddObserver(const EventObject & event,
unsigned long itk::Object::AddObserver(const EventObject & event,
Command * command);
bool IsDeprecated();
#if SWIGPYTHON
%extend
%extend
{
/** SetupLogger : Add the PythonLogOutput and setup the progress
/** SetupLogger : Add the PythonLogOutput and setup the progress
* reporting for the application */
%pythoncode
{
def SetupLogger(self):
logger = self.GetLogger()
logger.AddLogOutput(_libraryLogOutput.GetPointer())
self.progressReportManager = ProgressReporterManager_New()
self.progressReportManager.SetLogOutputCallback(_libraryLogCallback)
self.AddObserver(AddProcessToWatchEvent(),
......@@ -727,7 +727,7 @@ class ApplicationProxy(object):
"""
if (name == "thisown"):
return self.this.own()
if hasattr(Application, "__swig_getmethods__"):
method = Application.__swig_getmethods__.get(name, None)
if method:
......@@ -758,7 +758,7 @@ class ApplicationProxy(object):
if (name == "progressReportManager"):
super().__setattr__(name, value)
return
if hasattr(Application, "__swig_setmethods__"):
method = Application.__swig_setmethods__.get(name, None)
if method:
......@@ -814,7 +814,7 @@ class ApplicationProxy(object):
ImagePixelType_cfloat : SetVectorImageFromCFloatNumpyArray_,
ImagePixelType_cdouble : SetVectorImageFromCDoubleNumpyArray_,
}
def SetImageFromNumpyArray(self, paramKey, npArray, index=0):
"""
This method takes a numpy array and set ImageIOBase of
......
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