MCPcopy Index your code
hub / github.com/python/cpython / __create_handler

Method __create_handler

Lib/idlelib/multicall.py:161–188  ·  view source on GitHub ↗
(self, lists, mc_type, mc_state)

Source from the content-addressed store, hash-verified

159 # are binded.
160
161 def __create_handler(self, lists, mc_type, mc_state):
162 def handler(event, lists = lists,
163 mc_type = mc_type, mc_state = mc_state,
164 ishandlerrunning = self.ishandlerrunning,
165 doafterhandler = self.doafterhandler):
166 ishandlerrunning[:] = [True]
167 event.mc_type = mc_type
168 event.mc_state = mc_state
169 wascalled = {}
170 r = None
171 for l in lists:
172 for i in range(len(l)-1, -1, -1):
173 func = l[i]
174 if func not in wascalled:
175 wascalled[func] = True
176 r = l[i](event)
177 if r:
178 break
179 if r:
180 break
181 ishandlerrunning[:] = []
182 # Call all functions in doafterhandler and remove them from list
183 for f in doafterhandler:
184 f()
185 doafterhandler[:] = []
186 if r:
187 return r
188 return handler
189
190 def __init__(self, type, widget, widgetinst):
191 self.type = type

Callers 2

__init__Method · 0.95
bindMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected