Warning
This documentation is for an old version of IPython. You can find docs for newer versions here.
String dispatch class to match regexps and dispatch commands.
Bases: object
Dispatch (lookup) a set of strings / regexps for match.
Example:
>>> dis = StrDispatch()
>>> dis.add_s('hei',34, priority = 4)
>>> dis.add_s('hei',123, priority = 2)
>>> dis.add_re('h.i', 686)
>>> print list(dis.flat_matches('hei'))
[123, 34, 686]
Adds a target regexp for dispatching
Adds a target ‘string’ for dispatching
Get a seq of Commandchain objects that match key
Yield all ‘value’ targets, without priority