From eae38e50a80950d88b2613438a4705c3d6125a4d Mon Sep 17 00:00:00 2001 From: OceanWolf Date: Thu, 25 Jun 2015 02:19:16 +0200 Subject: [PATCH] super --- lib/matplotlib/backend_bases.py | 10 ++++++---- lib/matplotlib/backend_managers.py | 2 +- lib/matplotlib/backends/backend_gtk3.py | 11 ++++------- lib/matplotlib/cbook.py | 1 + 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index a009533bbf3b..3b23786d30e4 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -2623,8 +2623,8 @@ class WindowBase(cbook.EventEmitter): The title of the window. """ - def __init__(self, title): - cbook.EventEmitter.__init__(self) + def __init__(self, title, **kwargs): + super(WindowBase, self).__init__(**kwargs) def show(self): """ @@ -3405,7 +3405,8 @@ class ToolContainerBase(object): this `ToolContainer` wants to communicate with. """ - def __init__(self, toolmanager): + def __init__(self, toolmanager, **kwargs): + super(ToolContainerBase, self).__init__(**kwargs) self.toolmanager = toolmanager self.toolmanager.toolmanager_connect('tool_removed_event', self._remove_tool_cbk) @@ -3531,7 +3532,8 @@ def remove_toolitem(self, name): class StatusbarBase(object): """Base class for the statusbar""" - def __init__(self, toolmanager): + def __init__(self, toolmanager, **kwargs): + super(StatusbarBase, self).__init__(**kwargs) self.toolmanager = toolmanager self.toolmanager.toolmanager_connect('tool_message_event', self._message_cbk) diff --git a/lib/matplotlib/backend_managers.py b/lib/matplotlib/backend_managers.py index 8d06a7c04945..705f0506c3fb 100644 --- a/lib/matplotlib/backend_managers.py +++ b/lib/matplotlib/backend_managers.py @@ -71,7 +71,7 @@ class FigureManager(cbook.EventEmitter): The figure number. """ def __init__(self, figure, num): - cbook.EventEmitter.__init__(self) + super(FigureManager, self).__init__() self.num = num self._backend = get_backend() diff --git a/lib/matplotlib/backends/backend_gtk3.py b/lib/matplotlib/backends/backend_gtk3.py index aa30f61ff855..ceae2b887255 100644 --- a/lib/matplotlib/backends/backend_gtk3.py +++ b/lib/matplotlib/backends/backend_gtk3.py @@ -398,9 +398,8 @@ def stop_event_loop(self): class WindowGTK3(WindowBase, Gtk.Window): - def __init__(self, title): - WindowBase.__init__(self, title) - Gtk.Window.__init__(self) + def __init__(self, title, **kwargs): + super(WindowGTK3, self).__init__(title=title, **kwargs) self.set_window_title(title) try: @@ -835,8 +834,7 @@ def draw_rubberband(self, x0, y0, x1, y1): class ToolbarGTK3(ToolContainerBase, Gtk.Box): def __init__(self, toolmanager, flow='horizontal'): - ToolContainerBase.__init__(self, toolmanager) - Gtk.Box.__init__(self) + super(ToolbarGTK3, self).__init__(toolmanager=toolmanager) self._toolarea = Gtk.Box() self.set_flow(flow) @@ -923,8 +921,7 @@ def _add_separator(self): class StatusbarGTK3(StatusbarBase, Gtk.Statusbar): def __init__(self, *args, **kwargs): - StatusbarBase.__init__(self, *args, **kwargs) - Gtk.Statusbar.__init__(self) + super(StatusbarGTK3, self).__init__(*args, **kwargs) self._context = self.get_context_id('message') def set_message(self, s): diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 4cfc1eac11cb..a700a7527d62 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -568,6 +568,7 @@ def process(self, s, *args, **kwargs): class EventEmitter(object): def __init__(self): + super(EventEmitter, self).__init__() self._callbacks = CallbackRegistry() def mpl_connect(self, s, func):