Skip to content

Instantly share code, notes, and snippets.

@inklesspen
Created June 1, 2009 16:13
Show Gist options
  • Save inklesspen/121573 to your computer and use it in GitHub Desktop.
Save inklesspen/121573 to your computer and use it in GitHub Desktop.
class BaseController(WSGIController):
def __call__(self, environ, start_response):
"""Invoke the Controller"""
# WSGIController.__call__ dispatches to the Controller method
# the request is routed to. This routing information is
# available in environ['pylons.routes_dict']
# setup connection here. maybe store it in envion
try:
return WSGIController.__call__(self, environ, start_response)
finally:
# teardown connection here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment