diff --git a/capsul/pipeline/custom_nodes/cv_node.py b/capsul/pipeline/custom_nodes/cv_node.py index 896a01104..8b65d1973 100644 --- a/capsul/pipeline/custom_nodes/cv_node.py +++ b/capsul/pipeline/custom_nodes/cv_node.py @@ -26,9 +26,7 @@ def __init__(self, pipeline, name, input_type=None): in_fields.append({"name": tr, "optional": True}) for tr in out_fieldsl: out_fields.append({"name": tr, "optional": True}) - super(CrossValidationFoldNode, self).__init__( - None, pipeline, name, in_fields, out_fields - ) + super().__init__(None, pipeline, name, in_fields, out_fields) if input_type: ptype = input_type else: diff --git a/capsul/pipeline/custom_nodes/loo_node.py b/capsul/pipeline/custom_nodes/loo_node.py index 12f61d2b3..fdd25b7a8 100644 --- a/capsul/pipeline/custom_nodes/loo_node.py +++ b/capsul/pipeline/custom_nodes/loo_node.py @@ -47,9 +47,7 @@ def __init__( in_fields.append({"name": tr, "optional": True}) for tr in out_fieldsl: out_fields.append({"name": tr, "optional": True}) - super(LeaveOneOutNode, self).__init__( - None, pipeline, name, in_fields, out_fields - ) + super().__init__(None, pipeline, name, in_fields, out_fields) if input_type: ptype = input_type else: diff --git a/capsul/pipeline/custom_nodes/map_node.py b/capsul/pipeline/custom_nodes/map_node.py index 0b7f4ac0c..a1a4ce754 100644 --- a/capsul/pipeline/custom_nodes/map_node.py +++ b/capsul/pipeline/custom_nodes/map_node.py @@ -54,7 +54,7 @@ def __init__( for tr in input_names: in_fields.append({"name": tr, "optional": False}) - super(MapNode, self).__init__(None, pipeline, name, in_fields, out_fields) + super().__init__(None, pipeline, name, in_fields, out_fields) for tr, ptype in zip(input_names, ptypes): self.add_field(tr, list[ptype], output=False, default_factory=list) diff --git a/capsul/pipeline/custom_nodes/reduce_node.py b/capsul/pipeline/custom_nodes/reduce_node.py index 8d49044fc..1b7df4ae4 100644 --- a/capsul/pipeline/custom_nodes/reduce_node.py +++ b/capsul/pipeline/custom_nodes/reduce_node.py @@ -51,7 +51,7 @@ def __init__( for tr in output_names: out_fields.append({"name": tr, "optional": False}) - super(ReduceNode, self).__init__(None, pipeline, name, in_fields, out_fields) + super().__init__(None, pipeline, name, in_fields, out_fields) for tr, ptype in zip(output_names, ptypes): self.add_field( diff --git a/capsul/pipeline/custom_nodes/strcat_node.py b/capsul/pipeline/custom_nodes/strcat_node.py index 8c7eb7202..058349451 100644 --- a/capsul/pipeline/custom_nodes/strcat_node.py +++ b/capsul/pipeline/custom_nodes/strcat_node.py @@ -62,9 +62,7 @@ def __init__( node_inputs.append( {"name": concat_plug, "optional": concat_plug in make_optional} ) - super(StrCatNode, self).__init__( - None, pipeline, name, node_inputs, node_outputs - ) + super().__init__(None, pipeline, name, node_inputs, node_outputs) self._concat_sequence = params self._concat_plug = concat_plug self.add_parameters(param_types) diff --git a/capsul/pipeline/custom_nodes/strconv.py b/capsul/pipeline/custom_nodes/strconv.py index c8b6a0a74..a47267d0a 100644 --- a/capsul/pipeline/custom_nodes/strconv.py +++ b/capsul/pipeline/custom_nodes/strconv.py @@ -24,7 +24,7 @@ def __init__(self, pipeline, name, input_type=None): in_fields.append({"name": tr, "optional": True}) for tr in out_fieldsl: out_fields.append({"name": tr, "optional": True}) - super(StrConvNode, self).__init__(None, pipeline, name, in_fields, out_fields) + super().__init__(None, pipeline, name, in_fields, out_fields) if input_type: ptype = input_type else: diff --git a/capsul/pipeline/pipeline.py b/capsul/pipeline/pipeline.py index 041116c28..ccc7c31c0 100644 --- a/capsul/pipeline/pipeline.py +++ b/capsul/pipeline/pipeline.py @@ -217,8 +217,8 @@ def __init__(self, autoexport_nodes_parameters=None, **kwargs): raise TypeError("No definition string given to Pipeline constructor") # Inheritance - super(Pipeline, self).__init__(**kwargs) - super(Pipeline, self).add_field( + super().__init__(**kwargs) + super().add_field( "nodes_activation", Controller, hidden=self.hide_nodes_activation ) @@ -2319,9 +2319,7 @@ def check_requirements(self, environment="global", message_list=None): A pipeline will return a list of unique configuration values. """ # start with pipeline-level requirements - conf = super(Pipeline, self).check_requirements( - environment, message_list=message_list - ) + conf = super().check_requirements(environment, message_list=message_list) if conf is None: return None confs = [] diff --git a/capsul/pipeline/pipeline_nodes.py b/capsul/pipeline/pipeline_nodes.py index d09e8da90..5e1516bd0 100644 --- a/capsul/pipeline/pipeline_nodes.py +++ b/capsul/pipeline/pipeline_nodes.py @@ -320,7 +320,7 @@ def _any_attribute_changed(self, new, old, name): def __setstate__(self, state): self.__block_output_propagation = True - super(Switch, self).__setstate__(state) + super().__setstate__(state) def get_connections_through(self, plug_name, single=False): if not self.activated or not self.enabled: diff --git a/capsul/pipeline/process_iteration.py b/capsul/pipeline/process_iteration.py index 4653354a0..5b40f1702 100644 --- a/capsul/pipeline/process_iteration.py +++ b/capsul/pipeline/process_iteration.py @@ -26,7 +26,7 @@ def __init__(self, definition, process, iterative_parameters, context_name=None) # Avoid circular import from capsul.api import executable - super(ProcessIteration, self).__init__(definition=definition) + super().__init__(definition=definition) self.process = executable(process) if context_name is not None: self.process.context_name = context_name diff --git a/capsul/pipeline/test/test_activation.py b/capsul/pipeline/test/test_activation.py index de8cca2ca..5c5e4633b 100644 --- a/capsul/pipeline/test/test_activation.py +++ b/capsul/pipeline/test/test_activation.py @@ -9,9 +9,7 @@ class DummyProcess(Process): """Dummy Test Process""" def __init__(self, definition): - super(DummyProcess, self).__init__( - "capsul.pipeline.test.test_activation.DummyProcess" - ) + super().__init__("capsul.pipeline.test.test_activation.DummyProcess") # inputs self.add_field("input_image", File, optional=False) diff --git a/capsul/pipeline/test/test_double_switch.py b/capsul/pipeline/test/test_double_switch.py index f3e316419..1c9614360 100644 --- a/capsul/pipeline/test/test_double_switch.py +++ b/capsul/pipeline/test/test_double_switch.py @@ -7,9 +7,7 @@ class DummyProcess(Process): """Dummy Test Process""" def __init__(self, definition=None): - super(DummyProcess, self).__init__( - "capsul.pipeline.test.test_double_switch.DummyProcess" - ) + super().__init__("capsul.pipeline.test.test_double_switch.DummyProcess") # inputs self.add_field("input_image", str, optional=False) diff --git a/capsul/pipeline/test/test_optional_output_switch.py b/capsul/pipeline/test/test_optional_output_switch.py index 9bead6e53..b6e0d868c 100644 --- a/capsul/pipeline/test/test_optional_output_switch.py +++ b/capsul/pipeline/test/test_optional_output_switch.py @@ -10,9 +10,7 @@ class DummyProcess(Process): """Dummy Test Process""" def __init__(self, definition=None): - super(DummyProcess, self).__init__( - "capsul.pipeline.test.test_optional_output_switch" - ) + super().__init__("capsul.pipeline.test.test_optional_output_switch") # inputs self.add_field("input_image", File, optional=False) diff --git a/capsul/pipeline/test/test_pipeline.py b/capsul/pipeline/test/test_pipeline.py index 50095742e..667e28d9c 100644 --- a/capsul/pipeline/test/test_pipeline.py +++ b/capsul/pipeline/test/test_pipeline.py @@ -20,7 +20,7 @@ class DummyProcess(Process): def __init__(self, definition=None): if definition is None: definition = "capsul.pipeline.test.test_pipeline.DummyProcess" - super(DummyProcess, self).__init__(definition) + super().__init__(definition) # inputs self.add_field("input_image", File, optional=False) diff --git a/capsul/pipeline/test/test_pipeline_workflow.py b/capsul/pipeline/test/test_pipeline_workflow.py index 3410ef119..6e8cd0848 100644 --- a/capsul/pipeline/test/test_pipeline_workflow.py +++ b/capsul/pipeline/test/test_pipeline_workflow.py @@ -11,7 +11,7 @@ class DummyProcess(Process): """Dummy Test Process""" def __init__(self, definition): - super(DummyProcess, self).__init__(definition) + super().__init__(definition) # inputs self.add_field("input", File, optional=False) @@ -36,7 +36,7 @@ class DummyProcessSPM(DummyProcess): class DummyListProcess(Process): def __init__(self, definition): - super(DummyListProcess, self).__init__(definition) + super().__init__(definition) # inputs self.add_field("inputs", list[File], optional=False) diff --git a/capsul/pipeline/test/test_switch_pipeline.py b/capsul/pipeline/test/test_switch_pipeline.py index 067431608..b4667f321 100644 --- a/capsul/pipeline/test/test_switch_pipeline.py +++ b/capsul/pipeline/test/test_switch_pipeline.py @@ -11,7 +11,7 @@ class DummyProcess(Process): """Dummy Test Process""" def __init__(self, definition=None): - super(DummyProcess, self).__init__("capsul.pipeline.test.test_switch_pipeline") + super().__init__("capsul.pipeline.test.test_switch_pipeline") # inputs self.add_field("input_image", str, optional=False) diff --git a/capsul/pipeline/test/test_switch_subpipeline.py b/capsul/pipeline/test/test_switch_subpipeline.py index 72d6b0f1b..9fa034c0f 100644 --- a/capsul/pipeline/test/test_switch_subpipeline.py +++ b/capsul/pipeline/test/test_switch_subpipeline.py @@ -10,9 +10,7 @@ class DummyProcess(Process): """Dummy Test Process""" def __init__(self, definition=None): - super(DummyProcess, self).__init__( - "capsul.pipeline.test.test_switch_subpipeline.DummyProcess" - ) + super().__init__("capsul.pipeline.test.test_switch_subpipeline.DummyProcess") # inputs self.add_field("input_image", str, optional=False) @@ -31,9 +29,7 @@ class DummyProcess1_1(Process): """Dummy Test Process with 1 input and one output""" def __init__(self, definition=None): - super(DummyProcess1_1, self).__init__( - "capsul.pipeline.test.test_switch_subpipeline.DummyProcess1_1" - ) + super().__init__("capsul.pipeline.test.test_switch_subpipeline.DummyProcess1_1") # inputs self.add_field("input", str, optional=False) @@ -49,9 +45,7 @@ class DummyProcess2_1(Process): """Dummy Test Process with 2 inputs and one output""" def __init__(self, definition=None): - super(DummyProcess2_1, self).__init__( - "capsul.pipeline.test.test_switch_subpipeline.DummyProcess2_1" - ) + super().__init__("capsul.pipeline.test.test_switch_subpipeline.DummyProcess2_1") # inputs self.add_field("input1", str, optional=False) @@ -68,9 +62,7 @@ class DummyProcess4_1(Process): """Dummy Test Process with 4 inputs and one output""" def __init__(self, definition=None): - super(DummyProcess4_1, self).__init__( - "capsul.pipeline.test.test_switch_subpipeline.DummyProcess4_1" - ) + super().__init__("capsul.pipeline.test.test_switch_subpipeline.DummyProcess4_1") # inputs self.add_field("input1", str, optional=False) diff --git a/capsul/process/process.py b/capsul/process/process.py index febd690cc..bb99e2447 100644 --- a/capsul/process/process.py +++ b/capsul/process/process.py @@ -152,7 +152,7 @@ def json(self, include_parameters=True): return result def json_parameters(self): - return super(Process, self).json() + return super().json() def before_execute(self, context): """This method is called by CapsulEngine before calling @@ -543,7 +543,7 @@ def __init__( def before_execute(self, context): """Method to copy files before executing the process.""" - # super(FileCopyProcess, self).before_execute(context) + # super().before_execute(context) if self.destination is None: output_directory = getattr(self, "output_directory", None) @@ -583,7 +583,7 @@ def after_execute(self, exec_result, context): """Method to clean-up temporary workspace after process execution. """ - # exec_result = super(FileCopyProcess, self).after_execute( + # exec_result = super().after_execute( # exec_result, context) if self.use_temp_output_dir: self._move_outputs() @@ -914,7 +914,7 @@ def init_with_skip(self, *args, **kwargs): if len(stack) >= 2: s2 = stack[-2] if s2[2] == "nipype_factory": - instance = super(NipypeProcess, cls).__new__(cls, *args, **kwargs) + instance = super().__new__(cls, *args, **kwargs) setattr(instance, "__%s_np_init_done__" % cls.__name__, False) return instance nipype_class = getattr(cls, "_nipype_class_type", None) @@ -947,7 +947,7 @@ def init_with_skip(self, *args, **kwargs): instance.id = instance.__class__.__module__ + "." + instance.name instance.__postinit__(*nargs, **nkwargs) else: - instance = super(NipypeProcess, cls).__new__(cls, *args, **kwargs) + instance = super().__new__(cls, *args, **kwargs) setattr(instance, "__%s_np_init_done__" % cls.__name__, False) return instance @@ -1037,7 +1037,7 @@ class Smooth(NipypeProcess): return self.__NipypeProcess_np_init_done__ = True - # super(NipypeProcess, self).__init__(*args, **kwargs) + # super().__init__(*args, **kwargs) # Set some class attributes that characterize the nipype interface if nipype_instance is None: @@ -1076,7 +1076,7 @@ class Smooth(NipypeProcess): ] if use_temp_output_dir is None: use_temp_output_dir = True - super(NipypeProcess, self).__init__( + super().__init__( definition=definition, activate_copy=True, inputs_to_copy=inputs_to_copy, @@ -1089,7 +1089,7 @@ class Smooth(NipypeProcess): else: if use_temp_output_dir is None: use_temp_output_dir = False - super(NipypeProcess, self).__init__( + super().__init__( definition=definition, activate_copy=False, use_temp_output_dir=use_temp_output_dir, @@ -1220,4 +1220,4 @@ def after_execute(self, exec_result, context): ) if os.path.exists(script_file): shutil.move(script_file, getattr(self, script_tname)) - return super(NipypeProcess, self).after_execute(exec_result, context) + return super().after_execute(exec_result, context) diff --git a/capsul/process/test/test_metadata_schema.py b/capsul/process/test/test_metadata_schema.py index 75d9a92e6..5deb3bc2c 100644 --- a/capsul/process/test/test_metadata_schema.py +++ b/capsul/process/test/test_metadata_schema.py @@ -16,7 +16,7 @@ class DummyProcess(Process): f: float = field(output=False) def __init__(self, definition): - super(DummyProcess, self).__init__(definition) + super().__init__(definition) self.add_field("truc", type_=File, write=False) self.add_field("bidule", type_=File, write=True) diff --git a/capsul/qt_apps/pipeline_viewer_app.py b/capsul/qt_apps/pipeline_viewer_app.py index a501d0cc7..1bd9caef1 100644 --- a/capsul/qt_apps/pipeline_viewer_app.py +++ b/capsul/qt_apps/pipeline_viewer_app.py @@ -32,7 +32,7 @@ class PipelineViewerApp(Application): def __init__(self, *args, **kwargs): """Method to initialize the PipelineViewerApp class.""" # Inhetritance - super(PipelineViewerApp, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # Initialize the application self.window = None diff --git a/capsul/qt_gui/widgets/activation_inspector.py b/capsul/qt_gui/widgets/activation_inspector.py index 050511268..6838dcc2b 100644 --- a/capsul/qt_gui/widgets/activation_inspector.py +++ b/capsul/qt_gui/widgets/activation_inspector.py @@ -52,7 +52,7 @@ def __init__(self, pipeline_path, record_file=None, *args, **kwargs): a file where the pipeline activation steps are stored. """ # Inhetritance - super(ActivationInspectorApp, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # Load the pipeline self.pipeline = executable(pipeline_path) diff --git a/capsul/qt_gui/widgets/attributed_process_widget.py b/capsul/qt_gui/widgets/attributed_process_widget.py index e0f22065a..08b38319d 100644 --- a/capsul/qt_gui/widgets/attributed_process_widget.py +++ b/capsul/qt_gui/widgets/attributed_process_widget.py @@ -50,7 +50,7 @@ def __init__( user_level, and will only be visible if the ControllerWidget userl_evel is more than (or equal) the field level. """ - super(AttributedProcessWidget, self).__init__() + super().__init__() self.setLayout(QtGui.QVBoxLayout()) self.layout().setContentsMargins(0, 0, 0, 0) if exec_meta is None: diff --git a/capsul/qt_gui/widgets/links_debugger.py b/capsul/qt_gui/widgets/links_debugger.py index a24e48542..75c728b91 100644 --- a/capsul/qt_gui/widgets/links_debugger.py +++ b/capsul/qt_gui/widgets/links_debugger.py @@ -31,7 +31,7 @@ class CapsulLinkDebuggerView(QtGui.QWidget): VALUE = 4 def __init__(self, pipeline, ui_file=None, record_file=None, parent=None): - super(CapsulLinkDebuggerView, self).__init__(parent) + super().__init__(parent) # load the user interface window if ui_file is None: diff --git a/capsul/qt_gui/widgets/pipeline_developer_view.py b/capsul/qt_gui/widgets/pipeline_developer_view.py index b7e903a9d..d0c2c25fe 100644 --- a/capsul/qt_gui/widgets/pipeline_developer_view.py +++ b/capsul/qt_gui/widgets/pipeline_developer_view.py @@ -135,7 +135,7 @@ class Plug(Qt.QGraphicsPolygonItem): def __init__( self, color, name, height, width, activated=True, optional=False, parent=None ): - super(Plug, self).__init__(parent) + super().__init__(parent) self.name = name # self.color = self._color(activated, optional) self.color = color @@ -198,7 +198,7 @@ def get_plug_point(self): return self.mapToParent(point) def mousePressEvent(self, event): - super(Plug, self).mousePressEvent(event) + super().mousePressEvent(event) if event.button() == QtCore.Qt.LeftButton: self.scene().plug_clicked.emit(self.name) event.accept() @@ -214,7 +214,7 @@ class EmbeddedSubPipelineItem(Qt.QGraphicsProxyWidget): """ def __init__(self, sub_pipeline_wid): - super(EmbeddedSubPipelineItem, self).__init__() + super().__init__() old_height = sub_pipeline_wid.sizeHint().height() sizegrip = QtGui.QSizeGrip(None) new_height = old_height + sub_pipeline_wid.horizontalScrollBar().height() @@ -226,7 +226,7 @@ def __init__(self, sub_pipeline_wid): class boxItem(QtGui.QGraphicsRectItem): def __init__(self, parent=None): - super(boxItem, self).__init__(parent) + super().__init__(parent) # self.setFlags(self.ItemIsFocusable) self.penBox = 0 self.name = "" @@ -244,7 +244,7 @@ def keyPressEvent(self, event): self.scene()._node_keydelete_clicked(self) event.accept() else: - super(boxItem, self).keyPressEvent(event) + super().keyPressEvent(event) class NodeGWidget(QtGui.QGraphicsItem): @@ -263,7 +263,7 @@ def __init__( show_opt_outputs=True, userlevel=0, ): - super(NodeGWidget, self).__init__(parent) + super().__init__(parent) self.infoActived = QtGui.QGraphicsTextItem("", self) self.colType = ColorType() @@ -350,7 +350,7 @@ def __init__( def __del__(self): # print('NodeGWidget.__del__') self._release() - # super(NodeGWidget, self).__del__() + # super().__del__() @property def userlevel(self): @@ -1384,7 +1384,7 @@ def mousePressEvent(self, event): if isinstance(item, Plug): item.mousePressEvent(event) return - super(NodeGWidget, self).mousePressEvent(event) + super().mousePressEvent(event) process = get_ref(self.process) if event.button() == QtCore.Qt.RightButton and process is not None: self.scene().node_right_clicked.emit(self.name, process) @@ -1407,7 +1407,7 @@ def mousePressEvent(self, event): event.accept() def keyPressEvent(self, event): - super(NodeGWidget, self).keyPressEvent(event) + super().keyPressEvent(event) if event.key() == QtCore.Qt.Key_Up: self.setPos(self.x(), self.y() - 1) @@ -1426,7 +1426,7 @@ class HandleItem(QtGui.QGraphicsRectItem): """A handle that can be moved by the mouse""" def __init__(self, parent=None): - super(HandleItem, self).__init__(Qt.QRectF(-10.0, -10.0, 10.0, 10.0), parent) + super().__init__(Qt.QRectF(-10.0, -10.0, 10.0, 10.0), parent) # self.setRect(Qt.QRectF(-4.0,-4.0,4.0,4.0)) self.posChangeCallbacks = [] self.setPen(QtGui.QPen(QtCore.Qt.NoPen)) @@ -1466,7 +1466,7 @@ def itemChange(self, change, value): return value # Call superclass method: - return super(HandleItem, self).itemChange(change, value) + return super().itemChange(change, value) def mouseReleaseEvent(self, mouseEvent): self.setSelected(False) @@ -1476,7 +1476,7 @@ def mouseReleaseEvent(self, mouseEvent): class Link(QtGui.QGraphicsPathItem): def __init__(self, origin, target, active, weak, color, parent=None): - super(Link, self).__init__(parent) + super().__init__(parent) self._set_pen(active, weak, color) @@ -1553,7 +1553,7 @@ def mousePressEvent(self, event): # self: the scene has to help us. self.scene()._link_right_clicked(self) else: - super(Link, self).mousePressEvent(event) + super().mousePressEvent(event) event.accept() def focusInEvent(self, event): @@ -1571,7 +1571,7 @@ def keyPressEvent(self, event): self.scene()._link_keydelete_clicked(self) event.accept() else: - super(Link, self).keyPressEvent(event) + super().keyPressEvent(event) class PipelineScene(QtGui.QGraphicsScene): @@ -1600,7 +1600,7 @@ class PipelineScene(QtGui.QGraphicsScene): node_keydelete_clicked = QtCore.Signal(str) def __init__(self, parent=None, userlevel=0): - super(PipelineScene, self).__init__(parent) + super().__init__(parent) self.gnodes = {} self.glinks = {} @@ -2248,7 +2248,7 @@ def edition_enabled(self): return self._enable_edition def keyPressEvent(self, event): - super(PipelineScene, self).keyPressEvent(event) + super().keyPressEvent(event) if not event.isAccepted(): if event.key() == QtCore.Qt.Key_P: # print position of boxes @@ -2486,7 +2486,7 @@ def helpEvent(self, event): """ if self.logical_view: event.setAccepted(False) - super(PipelineScene, self).helpEvent(event) + super().helpEvent(event) return item = self.itemAt(event.scenePos(), Qt.QTransform()) if isinstance(item, Link): @@ -2526,7 +2526,7 @@ def helpEvent(self, event): # secondarily helpEvent() is protected. event.setAccepted(False) - super(PipelineScene, self).helpEvent(event) + super().helpEvent(event) def remove_node(self, node_name): print(self.gnodes) @@ -2705,7 +2705,7 @@ class ProcessNameEdit(Qt.QLineEdit): """A specialized QLineEdit with completion for process name""" def __init__(self, parent=None, class_type_check=is_executable): - super(PipelineDeveloperView.ProcessNameEdit, self).__init__(parent) + super().__init__(parent) self.compl = QtGui.QCompleter([]) self.setCompleter(self.compl) self.textEdited.connect(self.on_text_edited) @@ -2851,7 +2851,7 @@ def __init__( specified, then edition will be activated anyway. """ - super(PipelineDeveloperView, self).__init__(parent) + super().__init__(parent) # self.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft) self.setAlignment(QtCore.Qt.AlignCenter) @@ -2886,7 +2886,7 @@ def __init__( def __del__(self): # print('PipelineDeveloperView.__del__') self.release_pipeline(delete=True) - # super(PipelineDeveloperView, self).__del__() + # super().__del__() @property def userlevel(self): @@ -3151,10 +3151,10 @@ def wheelEvent(self, event): self.zoom_in() event.accept() if not done: - super(PipelineDeveloperView, self).wheelEvent(event) + super().wheelEvent(event) def mousePressEvent(self, event): - super(PipelineDeveloperView, self).mousePressEvent(event) + super().mousePressEvent(event) if not event.isAccepted(): if event.button() == QtCore.Qt.RightButton: self.open_background_menu() @@ -3179,7 +3179,7 @@ def mouseReleaseEvent(self, event): print("source to destination types are not compatible") print(e) - super(PipelineDeveloperView, self).mouseReleaseEvent(event) + super().mouseReleaseEvent(event) self.scene.update() def mouseMoveEvent(self, event): @@ -3197,7 +3197,7 @@ def mouseMoveEvent(self, event): self._move_grab_link(event) event.accept() else: - super(PipelineDeveloperView, self).mouseMoveEvent(event) + super().mouseMoveEvent(event) def dragEnterEvent(self, event): """Event handler when the mouse enters the widget. @@ -3314,7 +3314,7 @@ def window(self): if hasattr(self, "_graphics_item"): return self._graphics_item.scene().views()[0].window() else: - return super(PipelineDeveloperView, self).window() + return super().window() def onOpenProcessController(self, node_name, process): """Event to open a sub-process/sub-pipeline controller""" @@ -4222,7 +4222,7 @@ class ProcessModuleInput(QtGui.QDialog): def __init__( self, display_str="process module/name", class_type_check=is_executable ): - super(PipelineDeveloperView.ProcessModuleInput, self).__init__() + super().__init__() self.setWindowTitle("%s:" % display_str) layout = QtGui.QGridLayout(self) layout.addWidget(QtGui.QLabel("module/process:"), 0, 0) @@ -4378,7 +4378,7 @@ def get_node_instance(class_str, pipeline): class IterativeProcessInput(ProcessModuleInput): def __init__(self, engine): - super(PipelineDeveloperView.IterativeProcessInput, self).__init__() + super().__init__() # hlay = Qt.QHBoxLayout() # self.layout().addLayout(hlay) lay = self.layout() @@ -4449,7 +4449,7 @@ def add_switch(self): class SwitchInput(QtGui.QDialog): def __init__(self): - super(SwitchInput, self).__init__() + super().__init__() self.setWindowTitle("switch parameters/name:") layout = QtGui.QGridLayout(self) layout.addWidget(QtGui.QLabel("inputs:"), 0, 0) @@ -4490,7 +4490,7 @@ def __init__(self): # class SwitchInput(QtGui.QDialog): # def __init__(self): - # super(SwitchInput, self).__init__() + # super().__init__() # self.setWindowTitle('switch parameters/name:') # layout = QtGui.QGridLayout(self) # layout.addWidget(QtGui.QLabel('input:'), 0, 0) @@ -4731,14 +4731,14 @@ def get_doc_browser(self, create=False): class DocBrowser(QWebEngineView): def __init__(self, pview, *args, **kwargs): - super(DocBrowser, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.setAttribute(Qt.Qt.WA_DeleteOnClose) self.pview = pview def closeEvent(self, event): self.pview.doc_browser = None event.accept() - super(DocBrowser, self).closeEvent(event) + super().closeEvent(event) doc_browser = DocBrowser(pv) # QWebEngineView() pv.doc_browser = doc_browser @@ -4948,7 +4948,7 @@ def _plug_right_clicked(self, name): class _PlugEdit(QtGui.QDialog): def __init__(self, show_weak=True, parent=None): - super(PipelineDeveloperView._PlugEdit, self).__init__(parent) + super().__init__(parent) layout = QtGui.QVBoxLayout(self) hlay1 = QtGui.QHBoxLayout() layout.addLayout(hlay1) @@ -5102,7 +5102,7 @@ def new_pipeline(self): def load_pipeline(self, filename="", load_pipeline=True): class LoadProcessUi(Qt.QDialog): def __init__(self, parent=None, old_filename=""): - super(LoadProcessUi, self).__init__(parent) + super().__init__(parent) self.old_filename = old_filename lay = Qt.QVBoxLayout() self.setLayout(lay) @@ -5291,9 +5291,7 @@ def hint_tuples(item): else: return item - return super(MultiDimensionalArrayEncoder, self).encode( - hint_tuples(obj) - ) + return super().encode(hint_tuples(obj)) pipeline = self.scene.pipeline