summaryrefslogtreecommitdiff
path: root/python/decorators.py
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2022-05-06 00:25:41 -0400
committerJordan Wiens <jordan@psifertex.com>2022-05-06 00:25:41 -0400
commitbfeba3302e995fdba373603533fce54bf788adff (patch)
tree2e4aadbb53e43a7022167ecdff4e241474279e6d /python/decorators.py
parent245ee620d94a21d5e0005bd634a10bb6163efb64 (diff)
many pydoc formatting cleanups, added deprecated decorator and replaced ad-hoc messages with consistent decorator
Diffstat (limited to 'python/decorators.py')
-rw-r--r--python/decorators.py16
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