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

Method dispatch

IPython/utils/strdispatch.py:43–53  ·  view source on GitHub ↗

Get a seq of Commandchain objects that match key

(self, key)

Source from the content-addressed store, hash-verified

41 self.regexs[regex] = chain
42
43 def dispatch(self, key):
44 """ Get a seq of Commandchain objects that match key """
45 if key in self.strs:
46 yield self.strs[key]
47
48 for r, obj in self.regexs.items():
49 if re.match(r, key):
50 yield obj
51 else:
52 # print("nomatch",key) # dbg
53 pass
54
55 def __repr__(self):
56 return "<Strdispatch %s, %s>" % (self.strs, self.regexs)

Callers 1

flat_matchesMethod · 0.95

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected