diff options
author | Marcel Hellkamp <marc@gsites.de> | 2011-11-15 17:13:03 +0100 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2011-11-15 17:13:03 +0100 |
commit | 0cc5e09545274efed7b968989f3cf91a084eada7 (patch) | |
tree | 6291a82b2dd8a05280ec83a9292a096cc48b6600 | |
parent | a9431b6336cf56aec48c91c777839cef1c41a45b (diff) | |
download | bottle-0cc5e09545274efed7b968989f3cf91a084eada7.tar.gz |
Added Python 2.5 deprecation warning.
-rwxr-xr-x | bottle.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |