aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/app.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2012-12-16 00:45:57 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2012-12-23 12:26:34 +0100
commit05501c5742c85d0e2c855a02800d1f50f9df6c3d (patch)
treed30ed348bf57afb1e939899b41d30b31850b0b9d /mediagoblin/app.py
parent7880f03e2d9074c151306cbbdd7a247a020d8b55 (diff)
downloadmediagoblin-05501c5742c85d0e2c855a02800d1f50f9df6c3d.tar.lz
mediagoblin-05501c5742c85d0e2c855a02800d1f50f9df6c3d.tar.xz
mediagoblin-05501c5742c85d0e2c855a02800d1f50f9df6c3d.zip
Rewrite routing using new MGRoute class
MGRoute subclasses Rule(): Rule doesn't have a way to tag extra data, like the controller function, we need. So MGRoute has a new attribute .gmg_controller, which holds this. Rewrite everything to use this new Rule variant and drop all the other stuff that mapped endpoints to controller functions, mostly.
Diffstat (limited to 'mediagoblin/app.py')
-rw-r--r--mediagoblin/app.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mediagoblin/app.py b/mediagoblin/app.py
index ff64f65c..936a354f 100644
--- a/mediagoblin/app.py
+++ b/mediagoblin/app.py
@@ -184,7 +184,7 @@ class MediaGoblinApp(object):
mg_request.setup_user_in_request(request)
try:
- endpoint, url_values = map_adapter.match()
+ found_rule, url_values = map_adapter.match(return_rule=True)
request.matchdict = url_values
except HTTPException as exc:
# Stop and render exception
@@ -192,7 +192,7 @@ class MediaGoblinApp(object):
request, exc,
exc.get_description(environ))(environ, start_response)
- controller = endpoint_to_controller(endpoint)
+ controller = endpoint_to_controller(found_rule)
# pass the request through our meddleware classes
try: