mirror of https://github.com/ARMmbed/mbed-os.git
Create deprecated exporter class decorator
parent
7af22d0499
commit
ccc2105cd1
|
@ -25,6 +25,18 @@ class ExporterTargetsProperty(object):
|
||||||
def __get__(self, inst, cls):
|
def __get__(self, inst, cls):
|
||||||
return self.func(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):
|
class Exporter(object):
|
||||||
"""Exporter base class
|
"""Exporter base class
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue