annotate pylons_app/lib/base.py @ 0:564e40829f80

initial commit.
author Marcin Kuzminski
date Thu, 18 Feb 2010 13:01:57 +0100
parents
children 436bee78d81a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
1 """The base Controller API
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
2
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
3 Provides the BaseController class for subclassing.
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
4 """
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
5 from pylons.controllers import WSGIController
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
6 from pylons.templating import render_mako as render
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
7 from pylons_app.model import meta
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
8
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
9 class BaseController(WSGIController):
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
10
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
11 def __call__(self, environ, start_response):
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
12 """Invoke the Controller"""
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
13 # WSGIController.__call__ dispatches to the Controller method
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
14 # the request is routed to. This routing information is
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
15 # available in environ['pylons.routes_dict']
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
16 try:
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
17 return WSGIController.__call__(self, environ, start_response)
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
18 finally:
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
19 pass
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
20 #meta.Session.remove()