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

« back to all changes in this revision

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

Fixed an omission in XHTMLRESTView in which a template which had not
yet been loaded was being rendered.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 
18
 
# Author: Matt Giuca, Will Grant
 
18
# Author: Matt Giuca, Will Grant, Nick Chadwick
19
19
 
 
20
import os
20
21
import cgi
21
22
import urlparse
22
23
import inspect
168
169
        if self.template is None:
169
170
            raise NotImplementedError()
170
171
 
 
172
        rest_template = os.path.join(os.path.dirname(
 
173
                inspect.getmodule(self).__file__), self.template)
 
174
        loader = genshi.template.TemplateLoader(".", auto_reload=True)
 
175
        tmpl = loader.load(rest_template)
 
176
 
171
177
        return tmpl.generate(self.ctx).render('xhtml', doctype='xhtml')
172
178
    
173
179
    # This renders the template and adds it to the json