diff --git a/pyface/ui/null/action/tool_bar_manager.py b/pyface/ui/null/action/tool_bar_manager.py index 0b7c6f1a4..79450f738 100644 --- a/pyface/ui/null/action/tool_bar_manager.py +++ b/pyface/ui/null/action/tool_bar_manager.py @@ -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. diff --git a/pyface/ui/null/action/tool_palette.py b/pyface/ui/null/action/tool_palette.py index 13587ea17..5e1912c7f 100644 --- a/pyface/ui/null/action/tool_palette.py +++ b/pyface/ui/null/action/tool_palette.py @@ -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) diff --git a/pyface/ui/null/action/tool_palette_manager.py b/pyface/ui/null/action/tool_palette_manager.py index 69344b7bc..8ce83c22b 100644 --- a/pyface/ui/null/action/tool_palette_manager.py +++ b/pyface/ui/null/action/tool_palette_manager.py @@ -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. diff --git a/pyface/ui/wx/action/tool_bar_manager.py b/pyface/ui/wx/action/tool_bar_manager.py index c8a0f8795..1926638fd 100644 --- a/pyface/ui/wx/action/tool_bar_manager.py +++ b/pyface/ui/wx/action/tool_bar_manager.py @@ -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. diff --git a/pyface/ui/wx/action/tool_palette.py b/pyface/ui/wx/action/tool_palette.py index 384004ca8..c63e6d77a 100644 --- a/pyface/ui/wx/action/tool_palette.py +++ b/pyface/ui/wx/action/tool_palette.py @@ -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) diff --git a/pyface/ui/wx/action/tool_palette_manager.py b/pyface/ui/wx/action/tool_palette_manager.py index 3be0e5991..64d0924fc 100644 --- a/pyface/ui/wx/action/tool_palette_manager.py +++ b/pyface/ui/wx/action/tool_palette_manager.py @@ -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. diff --git a/pyface/ui/wx/application_window.py b/pyface/ui/wx/application_window.py index c89b6806c..17a44219b 100644 --- a/pyface/ui/wx/application_window.py +++ b/pyface/ui/wx/application_window.py @@ -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) @@ -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. diff --git a/pyface/ui/wx/directory_dialog.py b/pyface/ui/wx/directory_dialog.py index e15e429ca..d1e1b29d3 100644 --- a/pyface/ui/wx/directory_dialog.py +++ b/pyface/ui/wx/directory_dialog.py @@ -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. diff --git a/pyface/ui/wx/expandable_header.py b/pyface/ui/wx/expandable_header.py index 4c8dba6c8..0fb410cc7 100644 --- a/pyface/ui/wx/expandable_header.py +++ b/pyface/ui/wx/expandable_header.py @@ -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) diff --git a/pyface/ui/wx/expandable_panel.py b/pyface/ui/wx/expandable_panel.py index 5b9f57a01..07ec384cb 100644 --- a/pyface/ui/wx/expandable_panel.py +++ b/pyface/ui/wx/expandable_panel.py @@ -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) diff --git a/pyface/ui/wx/fields/field.py b/pyface/ui/wx/fields/field.py index 50308dd4d..b100ac8bc 100644 --- a/pyface/ui/wx/fields/field.py +++ b/pyface/ui/wx/fields/field.py @@ -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 diff --git a/pyface/ui/wx/file_dialog.py b/pyface/ui/wx/file_dialog.py index 1cd069082..bfe8a7564 100644 --- a/pyface/ui/wx/file_dialog.py +++ b/pyface/ui/wx/file_dialog.py @@ -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. diff --git a/pyface/ui/wx/grid/checkbox_image_renderer.py b/pyface/ui/wx/grid/checkbox_image_renderer.py index 3ebd42eee..a0f757665 100644 --- a/pyface/ui/wx/grid/checkbox_image_renderer.py +++ b/pyface/ui/wx/grid/checkbox_image_renderer.py @@ -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 diff --git a/pyface/ui/wx/grid/checkbox_renderer.py b/pyface/ui/wx/grid/checkbox_renderer.py index 4ba579e9a..50d393270 100644 --- a/pyface/ui/wx/grid/checkbox_renderer.py +++ b/pyface/ui/wx/grid/checkbox_renderer.py @@ -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: diff --git a/pyface/ui/wx/grid/composite_grid_model.py b/pyface/ui/wx/grid/composite_grid_model.py index a8f03f2ce..6fc05905e 100644 --- a/pyface/ui/wx/grid/composite_grid_model.py +++ b/pyface/ui/wx/grid/composite_grid_model.py @@ -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 diff --git a/pyface/ui/wx/grid/edit_image_renderer.py b/pyface/ui/wx/grid/edit_image_renderer.py index 9cea29383..1d978fcf4 100644 --- a/pyface/ui/wx/grid/edit_image_renderer.py +++ b/pyface/ui/wx/grid/edit_image_renderer.py @@ -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 """ diff --git a/pyface/ui/wx/grid/edit_renderer.py b/pyface/ui/wx/grid/edit_renderer.py index 33baf4a07..238371fc3 100644 --- a/pyface/ui/wx/grid/edit_renderer.py +++ b/pyface/ui/wx/grid/edit_renderer.py @@ -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: diff --git a/pyface/ui/wx/grid/grid.py b/pyface/ui/wx/grid/grid.py index 6cd7ef82e..e4332d393 100644 --- a/pyface/ui/wx/grid/grid.py +++ b/pyface/ui/wx/grid/grid.py @@ -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 diff --git a/pyface/ui/wx/grid/grid_model.py b/pyface/ui/wx/grid/grid_model.py index f2c89ff8a..bd6d4eac4 100644 --- a/pyface/ui/wx/grid/grid_model.py +++ b/pyface/ui/wx/grid/grid_model.py @@ -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 # ------------------------------------------------------------------------ diff --git a/pyface/ui/wx/grid/mapped_grid_cell_image_renderer.py b/pyface/ui/wx/grid/mapped_grid_cell_image_renderer.py index 473be5b07..ef6f83ca1 100644 --- a/pyface/ui/wx/grid/mapped_grid_cell_image_renderer.py +++ b/pyface/ui/wx/grid/mapped_grid_cell_image_renderer.py @@ -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 diff --git a/pyface/ui/wx/grid/simple_grid_model.py b/pyface/ui/wx/grid/simple_grid_model.py index 923dc19a5..fe68978d2 100644 --- a/pyface/ui/wx/grid/simple_grid_model.py +++ b/pyface/ui/wx/grid/simple_grid_model.py @@ -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 - # ------------------------------------------------------------------------ # 'GridModel' interface. # ------------------------------------------------------------------------ @@ -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 diff --git a/pyface/ui/wx/grid/trait_grid_model.py b/pyface/ui/wx/grid/trait_grid_model.py index b82553f47..cd0a65f03 100644 --- a/pyface/ui/wx/grid/trait_grid_model.py +++ b/pyface/ui/wx/grid/trait_grid_model.py @@ -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, diff --git a/pyface/ui/wx/heading_text.py b/pyface/ui/wx/heading_text.py index baf463f8a..377fe5d33 100644 --- a/pyface/ui/wx/heading_text.py +++ b/pyface/ui/wx/heading_text.py @@ -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) diff --git a/pyface/ui/wx/image_button.py b/pyface/ui/wx/image_button.py index 3fea514c3..be1801cdd 100644 --- a/pyface/ui/wx/image_button.py +++ b/pyface/ui/wx/image_button.py @@ -86,7 +86,7 @@ def __init__(self, parent, **traits): """ self._image = None - super(ImageButton, self).__init__(**traits) + super().__init__(**traits) self._recalc_size() diff --git a/pyface/ui/wx/image_widget.py b/pyface/ui/wx/image_widget.py index ea44d1081..059a9ab4e 100644 --- a/pyface/ui/wx/image_widget.py +++ b/pyface/ui/wx/image_widget.py @@ -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) diff --git a/pyface/ui/wx/ipython_widget.py b/pyface/ui/wx/ipython_widget.py index 7061bd657..3677bbc2b 100644 --- a/pyface/ui/wx/ipython_widget.py +++ b/pyface/ui/wx/ipython_widget.py @@ -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 @@ -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 @@ -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) diff --git a/pyface/ui/wx/layered_panel.py b/pyface/ui/wx/layered_panel.py index 93e2d1275..1acd40b02 100644 --- a/pyface/ui/wx/layered_panel.py +++ b/pyface/ui/wx/layered_panel.py @@ -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) diff --git a/pyface/ui/wx/list_box.py b/pyface/ui/wx/list_box.py index 02d57086c..31008d21a 100644 --- a/pyface/ui/wx/list_box.py +++ b/pyface/ui/wx/list_box.py @@ -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) diff --git a/pyface/ui/wx/mdi_application_window.py b/pyface/ui/wx/mdi_application_window.py index 0de509640..cf364d6cb 100644 --- a/pyface/ui/wx/mdi_application_window.py +++ b/pyface/ui/wx/mdi_application_window.py @@ -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 diff --git a/pyface/ui/wx/multi_toolbar_window.py b/pyface/ui/wx/multi_toolbar_window.py index be4e8bdea..3f35db64a 100644 --- a/pyface/ui/wx/multi_toolbar_window.py +++ b/pyface/ui/wx/multi_toolbar_window.py @@ -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 diff --git a/pyface/ui/wx/progress_dialog.py b/pyface/ui/wx/progress_dialog.py index 39e58349d..874eac27c 100644 --- a/pyface/ui/wx/progress_dialog.py +++ b/pyface/ui/wx/progress_dialog.py @@ -140,7 +140,7 @@ 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 @@ -148,7 +148,7 @@ def __init__(self, *args, **kw): def open(self): """ Opens the window. """ - super(ProgressDialog, self).open() + super().open() self._start_time = time.time() wx.GetApp().Yield(True) @@ -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 diff --git a/pyface/ui/wx/python_editor.py b/pyface/ui/wx/python_editor.py index 12cf06444..562ebf07d 100644 --- a/pyface/ui/wx/python_editor.py +++ b/pyface/ui/wx/python_editor.py @@ -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) diff --git a/pyface/ui/wx/python_shell.py b/pyface/ui/wx/python_shell.py index 0ba501736..f7061aa20 100644 --- a/pyface/ui/wx/python_shell.py +++ b/pyface/ui/wx/python_shell.py @@ -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) @@ -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, @@ -309,7 +309,7 @@ def Destroy(self): self.redirectStdin(False) builtins.raw_input = self.raw_input self.destroy() - super(PyShellBase, self).Destroy() + super().Destroy() class _NullIO(object): diff --git a/pyface/ui/wx/single_choice_dialog.py b/pyface/ui/wx/single_choice_dialog.py index 8eaa2d808..418256da2 100644 --- a/pyface/ui/wx/single_choice_dialog.py +++ b/pyface/ui/wx/single_choice_dialog.py @@ -63,7 +63,7 @@ def close(self): self.choice = self.choices[self.control.GetSelection()] # Let the window close as normal. - super(SingleChoiceDialog, self).close() + super().close() # ------------------------------------------------------------------------ # Protected 'IWidget' interface. diff --git a/pyface/ui/wx/tasks/editor_area_pane.py b/pyface/ui/wx/tasks/editor_area_pane.py index 305bd2db8..409957f72 100644 --- a/pyface/ui/wx/tasks/editor_area_pane.py +++ b/pyface/ui/wx/tasks/editor_area_pane.py @@ -68,7 +68,7 @@ def destroy(self): for editor in self.editors: self.remove_editor(editor) - super(EditorAreaPane, self).destroy() + super().destroy() # ------------------------------------------------------------------------ # 'IEditorAreaPane' interface. diff --git a/pyface/ui/wx/timer/timer.py b/pyface/ui/wx/timer/timer.py index 8f55aba2e..c072439e9 100644 --- a/pyface/ui/wx/timer/timer.py +++ b/pyface/ui/wx/timer/timer.py @@ -19,7 +19,7 @@ class CallbackTimer(wx.Timer): def __init__(self, timer): - super(CallbackTimer, self).__init__() + super().__init__() self.timer = timer def Notify(self): diff --git a/pyface/ui/wx/tree/tree.py b/pyface/ui/wx/tree/tree.py index d67919d8a..7bd99b502 100644 --- a/pyface/ui/wx/tree/tree.py +++ b/pyface/ui/wx/tree/tree.py @@ -178,7 +178,7 @@ def __init__(self, parent, image_size=(16, 16), **traits): """ # Base class constructors. - super(Tree, self).__init__(**traits) + super().__init__(**traits) # Create the toolkit-specific control. self.control = tree = _Tree( diff --git a/pyface/ui/wx/viewer/table_viewer.py b/pyface/ui/wx/viewer/table_viewer.py index f9f784385..75ccf9791 100644 --- a/pyface/ui/wx/viewer/table_viewer.py +++ b/pyface/ui/wx/viewer/table_viewer.py @@ -61,7 +61,7 @@ def __init__(self, parent, image_size=(16, 16), **traits): """ # Base-class constructor. - super(TableViewer, self).__init__(**traits) + super().__init__(**traits) # Create the toolkit-specific control. self.control = table = _Table(parent, image_size, self) diff --git a/pyface/ui/wx/viewer/tree_viewer.py b/pyface/ui/wx/viewer/tree_viewer.py index 172ebf6cd..3a302c896 100644 --- a/pyface/ui/wx/viewer/tree_viewer.py +++ b/pyface/ui/wx/viewer/tree_viewer.py @@ -89,7 +89,7 @@ def __init__(self, parent, image_size=(16, 16), **traits): """ # Base class constructor. - super(TreeViewer, self).__init__(**traits) + super().__init__(**traits) # Create the toolkit-specific control. self.control = tree = wx.TreeCtrl(parent, -1, style=self._get_style()) diff --git a/pyface/wx/drag_and_drop.py b/pyface/wx/drag_and_drop.py index 4b2ca9049..6c01433e3 100644 --- a/pyface/wx/drag_and_drop.py +++ b/pyface/wx/drag_and_drop.py @@ -53,7 +53,7 @@ def __init__(self, source, files): data_object.AddFile(file) # Create the drop source and begin the drag and drop operation: - super(FileDropSource, self).__init__(source) + super().__init__(source) self.SetData(data_object) self.result = self.DoDragDrop(True) @@ -164,7 +164,7 @@ def __init__(self, handler): """ # Base-class constructor. - super(PythonDropTarget, self).__init__() + super().__init__() # The handler can either be a function that will be called when # any data is dropped onto the target, or an instance that supports