MCPcopy Index your code
hub / github.com/ipython/ipython / add_re

Method add_re

IPython/utils/strdispatch.py:36–41  ·  view source on GitHub ↗

Adds a target regexp for dispatching

(self, regex, obj, priority= 0 )

Source from the content-addressed store, hash-verified

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 """

Callers 2

set_hookMethod · 0.80

Calls 3

getMethod · 0.80
addMethod · 0.45

Tested by 1