diff options
Diffstat (limited to 'python/decorators.py')
| -rw-r--r-- | python/decorators.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/python/decorators.py b/python/decorators.py index e02829f8..7c7025e3 100644 --- a/python/decorators.py +++ b/python/decorators.py @@ -1,6 +1,6 @@ def passive(cls): passive_note = ''' - + .. note:: This object is a "passive" object. Any changes you make to it will not be reflected in the core and vice-versa. If you wish to update a core version of this object you should use the appropriate API. ''' @@ -10,3 +10,17 @@ def passive(cls): cls.__doc__ = passive_note return cls + + +def deprecated(cls): + deprecated_note = ''' + .. warning:: This object is deprecated. Please migrate code away from using this class or method. + +''' + + if hasattr(cls, "__doc__") and cls.__doc__: + cls.__doc__ = deprecated_note + cls.__doc__ + else: + cls.__doc__ = deprecated_note + + return cls
\ No newline at end of file |
