Skip to content

Commit

Permalink
super
Browse files Browse the repository at this point in the history
  • Loading branch information
OceanWolf committed Jun 25, 2015
1 parent 8f29e31 commit eae38e5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 6 additions & 4 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backend_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
11 changes: 4 additions & 7 deletions lib/matplotlib/backends/backend_gtk3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit eae38e5

Please sign in to comment.