diff options
author | florent <florent.pigout@gmail.com> | 2011-07-09 00:33:26 (GMT) |
---|---|---|
committer | florent <florent.pigout@gmail.com> | 2011-07-09 00:33:26 (GMT) |
commit | 0767eedcd06485f30ee6b00df348b22847c7c7ad (patch) | |
tree | de339586453b0b638889ec607f4ded7de2edc05a /flask/session.py | |
parent | 89198c864831bea0a17f136b897aebc59f606166 (diff) |
make the flask based tools more clean for a nicer use -> move requirement to lib dir + limit import code to the minimumHEADmaster
Diffstat (limited to 'flask/session.py')
-rw-r--r-- | flask/session.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/flask/session.py b/flask/session.py deleted file mode 100644 index df2d877..0000000 --- a/flask/session.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -""" - flask.session - ~~~~~~~~~~~~~ - - Implements cookie based sessions based on Werkzeug's secure cookie - system. - - :copyright: (c) 2010 by Armin Ronacher. - :license: BSD, see LICENSE for more details. -""" - -from werkzeug.contrib.securecookie import SecureCookie - - -class Session(SecureCookie): - """Expands the session with support for switching between permanent - and non-permanent sessions. - """ - - def _get_permanent(self): - return self.get('_permanent', False) - - def _set_permanent(self, value): - self['_permanent'] = bool(value) - - permanent = property(_get_permanent, _set_permanent) - del _get_permanent, _set_permanent - - -class _NullSession(Session): - """Class used to generate nicer error messages if sessions are not - available. Will still allow read-only access to the empty session - but fail on setting. - """ - - def _fail(self, *args, **kwargs): - raise RuntimeError('the session is unavailable because no secret ' - 'key was set. Set the secret_key on the ' - 'application to something unique and secret.') - __setitem__ = __delitem__ = clear = pop = popitem = \ - update = setdefault = _fail - del _fail |