From ccc2105cd1d03702b59c29dde2c9df01f1e185ac Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 11 Jul 2017 11:14:52 -0500 Subject: [PATCH] Create deprecated exporter class decorator --- tools/export/exporters.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/export/exporters.py b/tools/export/exporters.py index 2598ce150a..090efd2aca 100644 --- a/tools/export/exporters.py +++ b/tools/export/exporters.py @@ -25,6 +25,18 @@ class ExporterTargetsProperty(object): def __get__(self, inst, cls): return self.func(cls) +def deprecated_exporter(CLS): + old_init = CLS.__init__ + old_name = CLS.NAME + def __init__(*args, **kwargs): + print("==================== DEPRECATION NOTICE ====================") + print("The exporter %s is no longer maintained, and deprecated." % old_name) + print("%s will be removed from mbed OS for the mbed OS 5.6 release." % old_name) + old_init(*args, **kwargs) + CLS.__init__ = __init__ + CLS.NAME = "%s (DEPRECATED)" % old_name + return CLS + class Exporter(object): """Exporter base class