Adds a target regexp for dispatching
(self, regex, obj, priority= 0 )
| 34 | self.strs[s] = chain |
| 35 | |
| 36 | def add_re(self, regex, obj, priority= 0 ): |
| 37 | """ Adds a target regexp for dispatching """ |
| 38 | |
| 39 | chain = self.regexs.get(regex, CommandChainDispatcher()) |
| 40 | chain.add(obj,priority) |
| 41 | self.regexs[regex] = chain |
| 42 | |
| 43 | def dispatch(self, key): |
| 44 | """ Get a seq of Commandchain objects that match key """ |