InvirtUnauthWeb classes, instead of in the fcgi configuration.
svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2730
'/': {
'tools.invirtwebstate.on': True,
},
'/': {
'tools.invirtwebstate.on': True,
},
- '/static': {
- 'tools.staticdir.root': static_dir,
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': static_dir,
- }
}
app = cherrypy.tree.mount(InvirtWeb(),
}
app = cherrypy.tree.mount(InvirtWeb(),
import cgi
import datetime
import hmac
import cgi
import datetime
import hmac
import random
import sha
import sys
import random
import sha
import sys
from view import View, revertStandardError
from view import View, revertStandardError
+
+static_dir = os.path.join(os.path.dirname(__file__), 'static')
+InvirtStatic = cherrypy.tools.staticdir.handler(
+ root=static_dir,
+ dir=static_dir,
+ section='/static')
+
class InvirtUnauthWeb(View):
class InvirtUnauthWeb(View):
+ static = InvirtStatic
+
@cherrypy.expose
@cherrypy.tools.mako(filename="/unauth.mako")
def index(self):
@cherrypy.expose
@cherrypy.tools.mako(filename="/unauth.mako")
def index(self):
'from invirt import database']
self._cp_config['request.error_response'] = self.handle_error
'from invirt import database']
self._cp_config['request.error_response'] = self.handle_error
+ static = InvirtStatic
+
@cherrypy.expose
@cherrypy.tools.mako(filename="/invalid.mako")
def invalidInput(self):
@cherrypy.expose
@cherrypy.tools.mako(filename="/invalid.mako")
def invalidInput(self):
'/': {
'tools.invirtwebstate.on': True,
},
'/': {
'tools.invirtwebstate.on': True,
},
- '/static': {
- 'tools.staticdir.root': static_dir,
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': static_dir,
- }
}
app = cherrypy.tree.mount(InvirtUnauthWeb(),
}
app = cherrypy.tree.mount(InvirtUnauthWeb(),