diff --git a/.pylintrc b/.pylintrc index dbd624b6..153f58b9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -57,9 +57,6 @@ generated-members= [BASIC] -# List of builtins function names that should not be used, separated by a comma -bad-functions= - # Regular expression which should only match correct module names module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ diff --git a/qubesmanager/firewall.py b/qubesmanager/firewall.py index 85589eba..d1bdd9d3 100644 --- a/qubesmanager/firewall.py +++ b/qubesmanager/firewall.py @@ -397,7 +397,7 @@ def index(self, row, column, parent=QtCore.QModelIndex()): return self.createIndex(row, column, self.children[row]) - def parent(self, child): # pylint: disable=unused-argument,no-self-use + def parent(self, child): # pylint: disable=unused-argument return QtCore.QModelIndex() # pylint: disable=invalid-name,unused-argument @@ -408,7 +408,7 @@ def rowCount(self, parent=QtCore.QModelIndex()): def columnCount(self, parent=QtCore.QModelIndex()): return len(self.__column_names) - # pylint: disable=invalid-name,no-self-use + # pylint: disable=invalid-name def hasChildren(self, index=QtCore.QModelIndex()): parent_item = index.internalPointer() return parent_item is None diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index abf6f7e0..d0a7c6ef 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -337,7 +337,10 @@ def get_vm(self, row=None, qid=None, name=None): return next(x for x in self._info_list if x.name == name) def update_model_data(self, *args, **kwargs): + # pylint: disable=unused-argument for vm_info in self._info_list: + # FIXME: add helper maybe? + # pylint: disable=protected-access vm_info.vm._power_state_cache = None vm_info.update() @@ -779,7 +782,8 @@ def __init__(self, qt_app, qubes_app, dispatcher, _parent=None): # Connect events self.dispatcher = dispatcher - dispatcher.add_handler('connection-established', self.qubes_cache.update_model_data) + dispatcher.add_handler('connection-established', + self.qubes_cache.update_model_data) dispatcher.add_handler('domain-pre-start', self.on_domain_status_changed) dispatcher.add_handler('domain-start', self.on_domain_status_changed) @@ -1627,7 +1631,6 @@ def action_global_settings_triggered(self): # pylint: disable=invalid-name # noinspection PyArgumentList @pyqtSlot(name='on_action_manage_templates_triggered') def action_manage_templates_triggered(self): - # pylint: disable=no-self-use subprocess.check_call('qubes-template-manager') # noinspection PyArgumentList @@ -1692,7 +1695,7 @@ def showhide_column(self, col_num, show): # noinspection PyArgumentList @pyqtSlot(name='on_action_about_qubes_triggered') - def action_about_qubes_triggered(self): # pylint: disable=no-self-use + def action_about_qubes_triggered(self): about = AboutDialog(self) about.exec_() diff --git a/qubesmanager/qvm_template_gui.py b/qubesmanager/qvm_template_gui.py index 7372bf88..ce828bdc 100644 --- a/qubesmanager/qvm_template_gui.py +++ b/qubesmanager/qvm_template_gui.py @@ -106,18 +106,15 @@ def createEditor(self, parent, option, index): return None def setEditorData(self, editor, index): - #pylint: disable=no-self-use cur = index.data() idx = editor.findText(cur) if idx >= 0: editor.setCurrentIndex(idx) def setModelData(self, editor, model, index): - #pylint: disable=no-self-use model.setData(index, editor.currentText()) def updateEditorGeometry(self, editor, option, index): - #pylint: disable=no-self-use _ = index # unused editor.setGeometry(option.rect) @@ -149,22 +146,18 @@ def index(self, row, column, parent=PyQt5.QtCore.QModelIndex()): return self.createIndex(row, column, self.children[row]) def parent(self, child): - #pylint: disable=no-self-use _ = child # unused return PyQt5.QtCore.QModelIndex() def rowCount(self, parent=PyQt5.QtCore.QModelIndex()): - #pylint: disable=no-self-use _ = parent # unused return len(self.children) def columnCount(self, parent=PyQt5.QtCore.QModelIndex()): - #pylint: disable=no-self-use _ = parent # unused return len(Template.COL_NAMES) def hasChildren(self, index=PyQt5.QtCore.QModelIndex()): - #pylint: disable=no-self-use return index == PyQt5.QtCore.QModelIndex() def data(self, index, role=PyQt5.QtCore.Qt.DisplayRole): @@ -200,7 +193,6 @@ def setData(self, index, value, role=PyQt5.QtCore.Qt.EditRole): def headerData(self, section, orientation, role=PyQt5.QtCore.Qt.DisplayRole): - #pylint: disable=no-self-use if section < len(Template.COL_NAMES) \ and orientation == PyQt5.QtCore.Qt.Horizontal \ and role == PyQt5.QtCore.Qt.DisplayRole: diff --git a/qubesmanager/utils.py b/qubesmanager/utils.py index b0fbbb1c..c5476816 100644 --- a/qubesmanager/utils.py +++ b/qubesmanager/utils.py @@ -75,7 +75,7 @@ def translate(string): class SizeSpinBox(QtWidgets.QSpinBox): """A SpinBox subclass with extended handling for sizes in MB and GB""" - # pylint: disable=invalid-name, no-self-use + # pylint: disable=invalid-name def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -363,8 +363,8 @@ def initialize_widget_with_labels(widget, qubes_app, labels = sorted(qubes_app.labels.values(), key=lambda l: l.index) choices = [(label.name, label) for label in labels] - icon_getter = (lambda label: - QtGui.QIcon.fromTheme(label.icon)) + def icon_getter(label): + return QtGui.QIcon.fromTheme(label.icon) if holder: initialize_widget_for_property(widget=widget,