milla.dispatch.traversal¶
URL Dispatching
Created: | Mar 26, 2011 |
---|---|
Author: | dustin |
Updated: | $Date$ |
Updater: | $Author$ |
- class milla.dispatch.traversal.Traverser(root)¶
Default URL dispatcher
Parameters: root – The root object at which lookup will begin The default URL dispatcher uses object attribute traversal to locate a handler for a given path. For example, consider the following class:
class Root(object): def foo(self): return 'Hello, world!'
The path /foo would resolve to the foo method of the Root class.
If a path cannot be resolved, UnresolvedPath will be raised.
- resolve(path_info)¶
Find a handler given a path
Parameters: path_info – Path for which to find a handler Returns: A handler callable