From 926fa28ddf31b14cd52eca5c960d82633b1a1d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr> Date: Fri, 3 May 2019 18:14:51 +0200 Subject: [PATCH] ENH: wrap application::IsDeprecated and display a warning message when creating a deprecated application in python --- Modules/Wrappers/SWIG/src/otbApplication.i | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/Wrappers/SWIG/src/otbApplication.i b/Modules/Wrappers/SWIG/src/otbApplication.i index 896016f85c..db1d073b28 100644 --- a/Modules/Wrappers/SWIG/src/otbApplication.i +++ b/Modules/Wrappers/SWIG/src/otbApplication.i @@ -225,6 +225,7 @@ public: unsigned long itk::Object::AddObserver(const EventObject & event, Command * command); + bool IsDeprecated(); #if SWIGPYTHON %extend @@ -906,6 +907,8 @@ public: application = _otbApplication.Registry_CreateApplicationWithoutLogger(name) if application is not None: application.SetupLogger() + if application.IsDeprecated(): + application.GetLogger().Warning("This application is deprecated and will be removed in a future OTB release") return application } #else -- GitLab