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

« back to all changes in this revision

Viewing changes to ivle/dispatch/__init__.py

Split ivle.webapp.forum.ForumView's board and topic special cases into
Forum{Board,Topic}View.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
from ivle.dispatch.request import Request
47
47
from ivle.dispatch import login
48
48
from ivle.webapp.base.plugins import ViewPlugin
49
 
from ivle.webapp.errors import HTTPError
50
49
import apps
51
50
import html
52
51
 
152
151
        # (The latter two seem to be built-in, and we don't want them).
153
152
        kwargs = matchdict.copy()
154
153
        del kwargs['view']
155
 
        try:
156
 
            # Instantiate the view, which should be a BaseView class
157
 
            view = viewcls(req, **kwargs)
158
 
            # Render the output
159
 
            view.render(req)
160
 
        except HTTPError, e:
161
 
            # A view explicitly raised an HTTP error. Respect it.
162
 
            req.status = e.code
163
 
            req.write(e.message)
164
 
            return e.code
165
 
        except Exception, e:
166
 
            # A non-HTTPError appeared. We have an unknown exception. Panic.
167
 
            handle_unknown_exception(req, *sys.exc_info())
168
 
        else:
169
 
            req.store.commit()
170
 
            return req.OK
 
154
        # Instantiate the view, which should be a BaseView class
 
155
        view = viewcls(req, **kwargs)
 
156
        # Render the output
 
157
        view.render(req)
 
158
        req.store.commit()
 
159
        return req.OK
171
160
    ### END New plugins framework ###
172
161
 
173
162
    # Check req.app to see if it is valid. 404 if not.