aboutsummaryrefslogtreecommitdiff
path: root/pandora/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'pandora/util.py')
-rw-r--r--pandora/util.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/pandora/util.py b/pandora/util.py
deleted file mode 100644
index e0fc7fd..0000000
--- a/pandora/util.py
+++ /dev/null
@@ -1,35 +0,0 @@
1"""
2Utility Functions
3
4Functions that don't have a home anywhere else.
5"""
6
7import warnings
8from functools import wraps
9
10
11def warn_deprecated(in_version, remove_version, what, message):
12 """Warn that something is deprecated
13 """
14 msg = ("{} is deprecated as of version {}"
15 " and will be removed in version {}. {}")
16
17 warnings.warn(
18 msg.format(what, in_version, remove_version, message),
19 DeprecationWarning)
20
21
22def deprecated(in_version, remove_version, message):
23 """Deprecated function decorator
24
25 Decorator to warn that a function is deprecated and what version it will be
26 removed in.
27 """
28 def wrapper(wrapped):
29 @wraps(wrapped)
30 def inner_wrapper(self, *args, **kwargs):
31 warn_deprecated(
32 in_version, remove_version, wrapped.__name__, message)
33 return wrapped(self, *args, **kwargs)
34 return inner_wrapper
35 return wrapper