~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/base/rest.py

  • Committer: William Grant
  • Date: 2010-02-26 06:33:35 UTC
  • Revision ID: grantw@unimelb.edu.au-20100226063335-25ka31up8cegwaiz
ivle.interpret.execute_raw now sets a clean environment, in particular with HOME set correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import genshi.template
27
27
 
28
28
from ivle.webapp.base.views import BaseView
 
29
from ivle.webapp.base.xhtml import GenshiLoaderMixin
29
30
from ivle.webapp.errors import BadRequest, MethodNotAllowed, Unauthorized
30
31
 
31
32
class RESTView(BaseView):
149
150
            req.write("\n")
150
151
 
151
152
 
152
 
class XHTMLRESTView(JSONRESTView):
 
153
class XHTMLRESTView(GenshiLoaderMixin, JSONRESTView):
153
154
    """A special type of RESTView which takes enhances the standard JSON
154
155
    with genshi XHTML functions.
155
156
    
164
165
 
165
166
        rest_template = os.path.join(os.path.dirname(
166
167
                inspect.getmodule(self).__file__), self.template)
167
 
        loader = genshi.template.TemplateLoader(".", auto_reload=True)
168
 
        tmpl = loader.load(rest_template)
 
168
        tmpl = self._loader.load(rest_template)
169
169
 
170
170
        return tmpl.generate(self.ctx).render('xhtml', doctype='xhtml')
171
171