@@ -115,9 +115,8 @@ def __init__(self, fig,
115
115
mouse_add = MouseButton .LEFT ,
116
116
mouse_pop = MouseButton .RIGHT ,
117
117
mouse_stop = MouseButton .MIDDLE ):
118
- BlockingInput .__init__ (self , fig = fig ,
119
- eventslist = ('button_press_event' ,
120
- 'key_press_event' ))
118
+ super ().__init__ (fig = fig ,
119
+ eventslist = ('button_press_event' , 'key_press_event' ))
121
120
self .button_add = mouse_add
122
121
self .button_pop = mouse_pop
123
122
self .button_stop = mouse_stop
@@ -239,7 +238,7 @@ def pop(self, event, index=-1):
239
238
Defaults to the last click.
240
239
"""
241
240
self .pop_click (event , index )
242
- BlockingInput .pop (self , index )
241
+ super () .pop (index )
243
242
244
243
def cleanup (self , event = None ):
245
244
"""
@@ -255,7 +254,7 @@ def cleanup(self, event=None):
255
254
self .marks = []
256
255
self .fig .canvas .draw ()
257
256
# Call base class to remove callbacks.
258
- BlockingInput .cleanup (self )
257
+ super () .cleanup ()
259
258
260
259
def __call__ (self , n = 1 , timeout = 30 , show_clicks = True ):
261
260
"""
@@ -264,7 +263,7 @@ def __call__(self, n=1, timeout=30, show_clicks=True):
264
263
self .show_clicks = show_clicks
265
264
self .clicks = []
266
265
self .marks = []
267
- BlockingInput .__call__ (self , n = n , timeout = timeout )
266
+ super () .__call__ (n = n , timeout = timeout )
268
267
return self .clicks
269
268
270
269
@@ -277,7 +276,7 @@ class BlockingContourLabeler(BlockingMouseInput):
277
276
278
277
def __init__ (self , cs ):
279
278
self .cs = cs
280
- BlockingMouseInput .__init__ (self , fig = cs .axes .figure )
279
+ super () .__init__ (fig = cs .axes .figure )
281
280
282
281
def add_click (self , event ):
283
282
self .button1 (event )
@@ -323,8 +322,7 @@ def button3(self, event):
323
322
def __call__ (self , inline , inline_spacing = 5 , n = - 1 , timeout = - 1 ):
324
323
self .inline = inline
325
324
self .inline_spacing = inline_spacing
326
- BlockingMouseInput .__call__ (self , n = n , timeout = timeout ,
327
- show_clicks = False )
325
+ super ().__call__ (n = n , timeout = timeout , show_clicks = False )
328
326
329
327
330
328
class BlockingKeyMouseInput (BlockingInput ):
@@ -333,8 +331,8 @@ class BlockingKeyMouseInput(BlockingInput):
333
331
"""
334
332
335
333
def __init__ (self , fig ):
336
- BlockingInput .__init__ (self , fig = fig , eventslist = (
337
- 'button_press_event' , 'key_press_event' ))
334
+ super () .__init__ (fig = fig ,
335
+ eventslist = ( 'button_press_event' , 'key_press_event' ))
338
336
339
337
def post_event (self ):
340
338
"""Determine if it is a key event."""
@@ -351,6 +349,6 @@ def __call__(self, timeout=30):
351
349
timed out.
352
350
"""
353
351
self .keyormouse = None
354
- BlockingInput .__call__ (self , n = 1 , timeout = timeout )
352
+ super () .__call__ (n = 1 , timeout = timeout )
355
353
356
354
return self .keyormouse
0 commit comments