Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyface/ui/null/action/tool_bar_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, *args, **traits):
""" Creates a new tool bar manager. """

# Base class contructor.
super(ToolBarManager, self).__init__(*args, **traits)
super().__init__(*args, **traits)

# An image cache to make sure that we only load each image used in the
# tool bar exactly once.
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/null/action/tool_palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, parent, **traits):
""" Creates a new tool palette. """

# Base class constructor.
super(ToolPalette, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/null/action/tool_palette_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, *args, **traits):
""" Creates a new tool bar manager. """

# Base class contructor.
super(ToolPaletteManager, self).__init__(*args, **traits)
super().__init__(*args, **traits)

# An image cache to make sure that we only load each image used in the
# tool bar exactly once.
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/action/tool_bar_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, *args, **traits):
""" Creates a new tool bar manager. """

# Base class contructor.
super(ToolBarManager, self).__init__(*args, **traits)
super().__init__(*args, **traits)

# An image cache to make sure that we only load each image used in the
# tool bar exactly once.
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/action/tool_palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self, parent, **traits):
""" Creates a new tool palette. """

# Base class constructor.
super(ToolPalette, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/action/tool_palette_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, *args, **traits):
""" Creates a new tool bar manager. """

# Base class contructor.
super(ToolPaletteManager, self).__init__(*args, **traits)
super().__init__(*args, **traits)

# An image cache to make sure that we only load each image used in the
# tool bar exactly once.
Expand Down
4 changes: 2 additions & 2 deletions pyface/ui/wx/application_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _size_default(self):

def _create(self):

super(ApplicationWindow, self)._create()
super()._create()

self._aui_manager = PyfaceAuiManager()
self._aui_manager.SetManagedWindow(self.control)
Expand Down Expand Up @@ -152,7 +152,7 @@ def _create_control(self, parent):
def destroy(self):
if self.control:
self._aui_manager.UnInit()
super(ApplicationWindow, self).destroy()
super().destroy()

# ------------------------------------------------------------------------
# Private interface.
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/directory_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def close(self):
self.path = str(self.control.GetPath())

# Let the window close as normal.
super(DirectoryDialog, self).close()
super().close()

# ------------------------------------------------------------------------
# Protected 'IWidget' interface.
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/expandable_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, parent, container, **traits):
""" Creates the panel. """

# Base class constructor.
super(ExpandableHeader, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/expandable_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, parent, **traits):
""" Creates a new LayeredPanel. """

# Base class constructor.
super(ExpandablePanel, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down
4 changes: 2 additions & 2 deletions pyface/ui/wx/fields/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ def _initialize_control(self):
# ------------------------------------------------------------------------

def _create(self):
super(Field, self)._create()
super()._create()
self._add_event_listeners()

def destroy(self):
self._remove_event_listeners()
super(Field, self).destroy()
super().destroy()

# ------------------------------------------------------------------------
# Private interface
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/file_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def close(self):
# Get the index of the selected filter.
self.wildcard_index = self.control.GetFilterIndex()
# Let the window close as normal.
super(FileDialog, self).close()
super().close()

# ------------------------------------------------------------------------
# Protected 'IWidget' interface.
Expand Down
4 changes: 1 addition & 3 deletions pyface/ui/wx/grid/checkbox_image_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def __init__(self, display_text=False):
text_map = {True: "True", False: "False"}

# Base-class constructor
super(CheckboxImageRenderer, self).__init__(
checked_image_map, text_map
)
super().__init__(checked_image_map, text_map)

return
2 changes: 1 addition & 1 deletion pyface/ui/wx/grid/checkbox_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CheckboxRenderer(GridCellRenderer):
def __init__(self, **traits):

# base-class constructor
super(CheckboxRenderer, self).__init__(**traits)
super().__init__(**traits)

# initialize the renderer, if it hasn't already been initialized
if self.renderer is None:
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/grid/composite_grid_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, **traits):
""" Create a CompositeGridModel object. """

# Base class constructor
super(CompositeGridModel, self).__init__(**traits)
super().__init__(**traits)

self._row_count = None

Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/grid/edit_image_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class EditImageRenderer(GridCellImageRenderer):
image = ImageResource("table_edit")

def __init__(self, **kw):
super(EditImageRenderer, self).__init__(self, **kw)
super().__init__(self, **kw)

def get_image_for_cell(self, grid, row, col):
""" returns the image resource for the table_edit bitmap """
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/grid/edit_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EditRenderer(GridCellRenderer):
def __init__(self, **traits):

# base-class constructor
super(EditRenderer, self).__init__(**traits)
super().__init__(**traits)

# initialize the renderer, if it hasn't already been initialized
if self.renderer is None:
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/grid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def __init__(self, parent, **traits):
"""

# Base class constructors.
super(Grid, self).__init__(**traits)
super().__init__(**traits)

# Flag set when columns are resizing:
self._user_col_size = False
Expand Down
11 changes: 0 additions & 11 deletions pyface/ui/wx/grid/grid_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@ class GridModel(HasPrivateTraits):
# Event fired when a cell is double-clicked on:
dclick = Event # = (row, column) that was double-clicked on

# ------------------------------------------------------------------------
# 'object' interface.
# ------------------------------------------------------------------------
def __init__(self, **traits):
""" Creates a new grid model. """

# Base class constructors.
super(GridModel, self).__init__(**traits)

return

# ------------------------------------------------------------------------
# 'GridModel' interface -- Subclasses MUST override the following
# ------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/grid/mapped_grid_cell_image_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MappedGridCellImageRenderer(GridCellImageRenderer):
def __init__(self, image_map=None, text_map=None):

# Base-class constructor. We pass ourself as the provider
super(MappedGridCellImageRenderer, self).__init__(self)
super().__init__(self)

self.image_map = image_map
self.text_map = text_map
Expand Down
13 changes: 1 addition & 12 deletions pyface/ui/wx/grid/simple_grid_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ class SimpleGridModel(GridModel):
# The columns in the model.
columns = Either(None, List(Instance(GridColumn)))

# ------------------------------------------------------------------------
# 'object' interface.
# ------------------------------------------------------------------------
def __init__(self, **traits):
""" Create a SimpleGridModel object. """

# Base class constructor
super(SimpleGridModel, self).__init__(**traits)

return
Comment on lines -40 to -49
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we removed this redundant redefinition of __init__


# ------------------------------------------------------------------------
# 'GridModel' interface.
# ------------------------------------------------------------------------
Expand Down Expand Up @@ -282,7 +271,7 @@ def __get_data_row(self, row):
class _CopyAction(Action):
def __init__(self, model, row, col, **kw):

super(_CopyAction, self).__init__(**kw)
super().__init__(**kw)
self._model = model
self._row = row
self._col = col
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/grid/trait_grid_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self, **traits):
""" Create a TraitGridModel object. """

# Base class constructor
super(TraitGridModel, self).__init__(**traits)
super().__init__(**traits)

# if no columns are pass in then create the list of names
# from the first trait in the list. if the list is empty,
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/heading_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, parent, **traits):
""" Creates the panel. """

# Base class constructor.
super(HeadingText, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/image_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, parent, **traits):
"""
self._image = None

super(ImageButton, self).__init__(**traits)
super().__init__(**traits)

self._recalc_size()

Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/image_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, parent, **traits):
""" Creates a new widget. """

# Base class constructors.
super(ImageWidget, self).__init__(**traits)
super().__init__(**traits)

# Add some padding around the image.
size = (self.bitmap.GetWidth() + 10, self.bitmap.GetHeight() + 10)
Expand Down
8 changes: 3 additions & 5 deletions pyface/ui/wx/ipython_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class IPython010Controller(IPythonController):
def execute_command(self, command, hidden=False):
# XXX: Overriden to fix bug where executing a hidden command still
# causes the prompt number to increase.
super(IPython010Controller, self).execute_command(command, hidden)
super().execute_command(command, hidden)
if hidden:
self.shell.current_cell_number -= 1

Expand Down Expand Up @@ -140,9 +140,7 @@ def complete(self, line):
"""

completion_text = self._get_completion_text(line)
suggestion, completions = super(IPython09Controller, self).complete(
completion_text
)
suggestion, completions = super().complete(completion_text)
new_line = line[: -len(completion_text)] + suggestion
return new_line, completions

Expand Down Expand Up @@ -348,7 +346,7 @@ def __init__(self, parent, **traits):
""" Creates a new pager. """

# Base class constructor.
super(IPythonWidget, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/layered_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, parent, **traits):
""" Creates a new LayeredPanel. """

# Base class constructor.
super(LayeredPanel, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/list_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, parent, **traits):
""" Creates a new list box. """

# Base-class constructors.
super(ListBox, self).__init__(**traits)
super().__init__(**traits)

# Create the widget!
self._create_control(parent)
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/mdi_application_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _create_contents(self, parent):
# Let the AUI manager look after the frame.
self._aui_manager.SetManagedWindow(self.control)

contents = super(MDIApplicationWindow, self)._create_contents(parent)
contents = super()._create_contents(parent)

return contents

Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/multi_toolbar_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MultiToolbarWindow(ApplicationWindow):
# Protected 'Window' interface.
# ------------------------------------------------------------------------
def _create_contents(self, parent):
panel = super(MultiToolbarWindow, self)._create_contents(parent)
panel = super()._create_contents(parent)
self._create_trim_widgets(parent)

return panel
Expand Down
6 changes: 3 additions & 3 deletions pyface/ui/wx/progress_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ def __init__(self, *args, **kw):
# before open() is called
self._start_time = 0

super(ProgressDialog, self).__init__(*args, **kw)
super().__init__(*args, **kw)

# -------------------------------------------------------------------------
# IWindow Interface
# -------------------------------------------------------------------------

def open(self):
""" Opens the window. """
super(ProgressDialog, self).open()
super().open()
self._start_time = time.time()
wx.GetApp().Yield(True)

Expand All @@ -161,7 +161,7 @@ def close(self):
if self._message_control is not None:
self._message_control = None

super(ProgressDialog, self).close()
super().close()

# -------------------------------------------------------------------------
# IProgressDialog Interface
Expand Down
2 changes: 1 addition & 1 deletion pyface/ui/wx/python_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, parent, **traits):
""" Creates a new pager. """

# Base class constructor.
super(PythonEditor, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down
6 changes: 3 additions & 3 deletions pyface/ui/wx/python_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self, parent, **traits):
""" Creates a new pager. """

# Base class constructor.
super(PythonShell, self).__init__(**traits)
super().__init__(**traits)

# Create the toolkit-specific control that represents the widget.
self.control = self._create_control(parent)
Expand Down Expand Up @@ -263,7 +263,7 @@ def __init__(
# wx.py.shell dosent reassign it back to the original on destruction
self.raw_input = input

super(PyShell, self).__init__(
super().__init__(
parent,
id,
pos,
Expand Down Expand Up @@ -309,7 +309,7 @@ def Destroy(self):
self.redirectStdin(False)
builtins.raw_input = self.raw_input
self.destroy()
super(PyShellBase, self).Destroy()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a potentially buggy use of super

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strange as I believe PyShellBase only has a destroy method not a Destroy method:
https://wxpython.org/Phoenix/docs/html/wx.py.shell.Shell.html#wx.py.shell.Shell.destroy

Actually Destroy is defined much further up the inheritance tree: https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.Destroy

super().Destroy()


class _NullIO(object):
Expand Down
Loading