from mako.lookup import TemplateLookup
import simplejson
import datetime, decimal
+from invirt.config import structs as config
+from webcommon import State
class MakoHandler(cherrypy.dispatch.LateParamPageHandler):
"""Callable which sets response.body."""
cherrypy.tools.require_login = cherrypy.Tool('on_start_resource', require_login)
+def invirtwebstate_init():
+ """Initialize the cherrypy.request.state object from Invirt"""
+ cherrypy.request.state = State(cherrypy.request.login)
+
+cherrypy.tools.invirtwebstate = cherrypy.Tool('on_start_resource', invirtwebstate_init, priority=100)
+
class View(object):
_cp_config = {'tools.mako.directories': [os.path.join(os.path.dirname(__file__),'templates')]}