summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hellkamp <marc@gsites.de>2011-11-15 17:13:03 +0100
committerMarcel Hellkamp <marc@gsites.de>2011-11-15 17:13:03 +0100
commit0cc5e09545274efed7b968989f3cf91a084eada7 (patch)
tree6291a82b2dd8a05280ec83a9292a096cc48b6600
parenta9431b6336cf56aec48c91c777839cef1c41a45b (diff)
downloadbottle-0cc5e09545274efed7b968989f3cf91a084eada7.tar.gz
Added Python 2.5 deprecation warning.
-rwxr-xr-xbottle.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bottle.py b/bottle.py
index 595fbc8..154e67f 100755
--- a/bottle.py
+++ b/bottle.py
@@ -84,6 +84,10 @@ except ImportError: # pragma: no cover
py3k = sys.version_info >= (3,0,0)
NCTextIOWrapper = None
+if sys.version_info < (2,6,0):
+ msg = "Python 2.5 support may be dropped in future versions of Bottle."
+ warnings.warn(msg, DeprecationWarning)
+
if py3k: # pragma: no cover
json_loads = lambda s: json_lds(touni(s))
# See Request.POST
@@ -124,6 +128,7 @@ def makelist(data):
elif data: return [data]
else: return []
+
class DictProperty(object):
''' Property that maps to a key in a local dict-like attribute. '''
def __init__(self, attr, key=None, read_only=False):
@@ -148,6 +153,7 @@ class DictProperty(object):
if self.read_only: raise AttributeError("Read-Only property.")
del getattr(obj, self.attr)[self.key]
+
class CachedProperty(object):
''' A property that is only computed once per instance and then replaces
itself with an ordinary attribute. Deleting the attribute resets the