Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c44e744

Browse files
committed
super
1 parent 860a8ed commit c44e744

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,8 +2639,8 @@ class WindowBase(cbook.EventEmitter):
26392639
The title of the window.
26402640
"""
26412641

2642-
def __init__(self, title):
2643-
cbook.EventEmitter.__init__(self)
2642+
def __init__(self, title, **kwargs):
2643+
super(WindowBase, self).__init__(**kwargs)
26442644

26452645
def show(self):
26462646
"""
@@ -3349,7 +3349,8 @@ class ToolContainerBase(object):
33493349
this `ToolContainer` wants to communicate with.
33503350
"""
33513351

3352-
def __init__(self, toolmanager):
3352+
def __init__(self, toolmanager, **kwargs):
3353+
super(ToolContainerBase, self).__init__(**kwargs)
33533354
self.toolmanager = toolmanager
33543355
self.toolmanager.toolmanager_connect('tool_removed_event',
33553356
self._remove_tool_cbk)
@@ -3475,7 +3476,8 @@ def remove_toolitem(self, name):
34753476

34763477
class StatusbarBase(object):
34773478
"""Base class for the statusbar"""
3478-
def __init__(self, toolmanager):
3479+
def __init__(self, toolmanager, **kwargs):
3480+
super(StatusbarBase, self).__init__(**kwargs)
34793481
self.toolmanager = toolmanager
34803482
self.toolmanager.toolmanager_connect('tool_message_event',
34813483
self._message_cbk)

lib/matplotlib/backend_managers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class FigureManager(cbook.EventEmitter):
7474
The figure number.
7575
"""
7676
def __init__(self, figure, num):
77-
cbook.EventEmitter.__init__(self)
77+
super(FigureManager, self).__init__()
7878
self.num = num
7979

8080
self._backend = get_backend()

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,8 @@ def stop_event_loop(self):
391391

392392

393393
class WindowGTK3(WindowBase, Gtk.Window):
394-
def __init__(self, title):
395-
WindowBase.__init__(self, title)
396-
Gtk.Window.__init__(self)
394+
def __init__(self, title, **kwargs):
395+
super(WindowGTK3, self).__init__(title=title, **kwargs)
397396
self.set_window_title(title)
398397

399398
try:
@@ -829,8 +828,7 @@ def draw_rubberband(self, x0, y0, x1, y1):
829828

830829
class ToolbarGTK3(ToolContainerBase, Gtk.Box):
831830
def __init__(self, toolmanager, flow='horizontal'):
832-
ToolContainerBase.__init__(self, toolmanager)
833-
Gtk.Box.__init__(self)
831+
super(ToolbarGTK3, self).__init__(toolmanager=toolmanager)
834832
self._toolarea = Gtk.Box()
835833
self.set_flow(flow)
836834

@@ -917,8 +915,7 @@ def _add_separator(self):
917915

918916
class StatusbarGTK3(StatusbarBase, Gtk.Statusbar):
919917
def __init__(self, *args, **kwargs):
920-
StatusbarBase.__init__(self, *args, **kwargs)
921-
Gtk.Statusbar.__init__(self)
918+
super(StatusbarGTK3, self).__init__(*args, **kwargs)
922919
self._context = self.get_context_id('message')
923920

924921
def set_message(self, s):

lib/matplotlib/cbook.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ def process(self, s, *args, **kwargs):
545545

546546
class EventEmitter(object):
547547
def __init__(self):
548+
super(EventEmitter, self).__init__()
548549
self._callbacks = CallbackRegistry()
549550

550551
def mpl_connect(self, s, func):

0 commit comments

Comments
 (0)