diff -r d3668ecd9137 -r 738abc5935c9 ztfy/utils/session.py --- a/ztfy/utils/session.py Wed Jun 20 16:29:53 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -### -*- coding: utf-8 -*- #################################################### -############################################################################## -# -# Copyright (c) 2008-2010 Thierry Florac -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# -############################################################################## - -__docformat__ = "restructuredtext" - -# import standard packages - -# import Zope3 interfaces -from zope.session.interfaces import ISession - -# import local interfaces - -# import Zope3 packages - -# import local packages -from security import unproxied - - -def getData(request, app, key, default=None): - """Get data associated with a given session""" - session = ISession(request)[app] - return session.get(key, default) - - -def setData(request, app, key, value): - """Set data associated to a given session""" - session = ISession(request)[app] - session[key] = unproxied(value)