~chris-atlee/blobs/main

« back to all changes in this revision

Viewing changes to blobs/controllers/__init__.py

  • Committer: Chris AtLee
  • Date: 2008-02-19 16:55:03 UTC
  • Revision ID: chris@atlee.ca-20080219165503-0i5wcwtx04zphrhd
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""The base Controller API
 
2
 
 
3
Provides the BaseController class for subclassing, and other objects
 
4
utilized by Controllers.
 
5
"""
 
6
from pylons import c, cache, config, g, request, response, session
 
7
from pylons.controllers import WSGIController
 
8
from pylons.controllers.util import abort, etag_cache, redirect_to
 
9
from pylons.decorators import jsonify, validate
 
10
from pylons.i18n import _, ungettext, N_
 
11
from pylons.templating import render
 
12
 
 
13
import blobs.helpers as h
 
14
 
 
15
from blobs.model import *
 
16
 
 
17
class BaseController(WSGIController):
 
18
    def __call__(self, environ, start_response):
 
19
        """Invoke the Controller"""
 
20
        # WSGIController.__call__ dispatches to the Controller method
 
21
        # the request is routed to. This routing information is
 
22
        # available in environ['pylons.routes_dict']
 
23
        try:
 
24
            return WSGIController.__call__(self, environ, start_response)
 
25
        finally:
 
26
            Session.remove()
 
27
 
 
28
# Include the '_' function in the public names
 
29
__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \
 
30
           or __name == '_']