Changeset 2669 for package_branches/invirt-web/cherrypy-rebased
- Timestamp:
- Dec 20, 2009, 9:44:15 PM (15 years ago)
- Location:
- package_branches/invirt-web/cherrypy-rebased/code
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy-rebased/code/main.fcgi
r2661 r2669 20 20 app = cherrypy.tree.mount(InvirtWeb(), 21 21 '/' if dev else '/main.fcgi', 22 {'/': {'tools.staticdir.root': static_dir}, 22 {'/': {'tools.staticdir.root': static_dir, 23 'tools.invirtwebstate.on': True}, 23 24 '/static': {'tools.staticdir.on': True, 24 25 'tools.staticdir.dir': static_dir} -
package_branches/invirt-web/cherrypy-rebased/code/main.py
r2668 r2669 56 56 @cherrypy.expose 57 57 @cherrypy.tools.mako(filename="/list.mako") 58 def list(self , username):58 def list(self): 59 59 """Handler for list requests.""" 60 60 checkpoint.checkpoint('Getting list dict') 61 d = getListDict( username,state)61 d = getListDict(cherrypy.request.login, cherrypy.request.state) 62 62 checkpoint.checkpoint('Got list dict') 63 63 return d -
package_branches/invirt-web/cherrypy-rebased/code/view.py
r2665 r2669 6 6 import simplejson 7 7 import datetime, decimal 8 from invirt.config import structs as config 9 from webcommon import State 8 10 9 11 class MakoHandler(cherrypy.dispatch.LateParamPageHandler): … … 79 81 cherrypy.tools.require_login = cherrypy.Tool('on_start_resource', require_login) 80 82 83 def invirtwebstate_init(): 84 """Initialize the cherrypy.request.state object from Invirt""" 85 cherrypy.request.state = State(cherrypy.request.login) 86 87 cherrypy.tools.invirtwebstate = cherrypy.Tool('on_start_resource', invirtwebstate_init, priority=100) 88 81 89 class View(object): 82 90 _cp_config = {'tools.mako.directories': [os.path.join(os.path.dirname(__file__),'templates')]}
Note: See TracChangeset
for help on using the changeset viewer.