|
a/Allura/allura/controllers/base.py |
|
b/Allura/allura/controllers/base.py |
|
... |
|
... |
21 |
Use default dispatching for other urls.
|
21 |
Use default dispatching for other urls.
|
22 |
|
22 |
|
23 |
Use this class as a mixin to controller that needs such behaviour.
|
23 |
Use this class as a mixin to controller that needs such behaviour.
|
24 |
(see allura.controllers.repository.TreeBrowser for an example)
|
24 |
(see allura.controllers.repository.TreeBrowser for an example)
|
25 |
"""
|
25 |
"""
|
|
|
26 |
dispatcher = ObjectDispatcher()
|
|
|
27 |
|
26 |
def _dispatch(self, state, remainder):
|
28 |
def _dispatch(self, state, remainder):
|
27 |
dispatcher = ObjectDispatcher()
|
29 |
dispatcher = self.dispatcher
|
28 |
if remainder and remainder[0] == 'index':
|
30 |
if remainder and remainder[0] == 'index':
|
29 |
controller, new_remainder = self._lookup(*remainder)
|
31 |
controller, new_remainder = self._lookup(*remainder)
|
30 |
state.add_controller(controller.__class__.__name__, controller)
|
32 |
state.add_controller(controller.__class__.__name__, controller)
|
31 |
dispatcher = getattr(controller, '_dispatch', dispatcher._dispatch)
|
33 |
dispatcher = getattr(controller, '_dispatch', dispatcher._dispatch)
|
32 |
return dispatcher(state, new_remainder)
|
34 |
return dispatcher(state, new_remainder)
|