Commit 9b2ab621 authored by Cédric Traizet's avatar Cédric Traizet

BUG: store the progressReportManager inside the application class instead of having a global one

parent 63417576
Pipeline #2361 failed with stages
in 61 minutes and 32 seconds
......@@ -271,8 +271,10 @@ public:
logger = self.GetLogger()
logger.AddLogOutput(_libraryLogOutput.GetPointer())
self.progressReportManager = ProgressReporterManager_New()
self.progressReportManager.SetLogOutputCallback(_libraryLogCallback)
self.AddObserver(AddProcessToWatchEvent(),
_libraryProgressReportManager.GetAddProcessCommand()
self.progressReportManager.GetAddProcessCommand()
)
}
}
......@@ -743,6 +745,8 @@ class ApplicationProxy(object):
key_list = [k.upper() for k in self.GetParametersKeys(True)]
if name in key_list:
self.SetParameterValue(name.lower(), value)
if (name == "progressReportManager"):
super().__setattr__(name, value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
......
......@@ -91,9 +91,7 @@ class ProgressReporterManager: public itkObject
{
public:
/** Default constructor */
static ProgressReporterManager_Pointer New();
virtual void Delete();
void DeleteWatcherList();
void SetLogOutputCallback(otb::SwigPrintCallback* callback);
itkCommand* GetAddProcessCommand();
......@@ -109,14 +107,10 @@ DECLARE_REF_COUNT_CLASS( ProgressReporterManager )
%pythoncode {
_libraryLogOutput = PythonLogOutput_New()
_libraryLogCallback = PythonPrintCallback()
_libraryProgressReportManager = ProgressReporterManager_New()
Logger.Instance().ResetOutputs()
_libraryLogOutput.SetCallback(_libraryLogCallback)
Logger.Instance().AddLogOutput(_libraryLogOutput.GetPointer())
_libraryProgressReportManager.SetLogOutputCallback(_libraryLogCallback)
}
#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