From 59aa70a17a20823d0fc00cc3ef53bf88457f1950 Mon Sep 17 00:00:00 2001 From: Rafael Irgolic Date: Thu, 7 Jan 2021 20:25:20 +0000 Subject: [PATCH] pylint --- Orange/widgets/data/owcsvimport.py | 13 ++++++------- Orange/widgets/utils/textimport.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Orange/widgets/data/owcsvimport.py b/Orange/widgets/data/owcsvimport.py index 803d2bb8c36..6d5bb068b41 100644 --- a/Orange/widgets/data/owcsvimport.py +++ b/Orange/widgets/data/owcsvimport.py @@ -40,8 +40,8 @@ ) from PyQt5.QtWidgets import ( QLabel, QComboBox, QPushButton, QDialog, QDialogButtonBox, QGridLayout, - QVBoxLayout, QSizePolicy, QStyle, QFileIconProvider, QFileDialog, - QApplication, QMessageBox, QTextBrowser, QMenu + QVBoxLayout, QSizePolicy, QFileIconProvider, QFileDialog, + QApplication, QMessageBox, QTextBrowser ) from PyQt5.QtCore import pyqtSlot as Slot, pyqtSignal as Signal @@ -956,7 +956,7 @@ def _path_must_be_relative_mb(self, prefix: str) -> QMessageBox: return mb @Slot() - def browse(self, prefixname=None, directory=None): + def browse(self): """ Open a file dialog and select a user specified file. """ @@ -984,7 +984,7 @@ def browse(self, prefixname=None, directory=None): if not mtype.inherits("text/plain"): mb = self._might_be_binary_mb(path) if mb.exec() == QMessageBox.Cancel: - return + return False # initialize dialect based on selected format dialect, header = default_options_for_mime_type( path, selected_filter.mime_type, @@ -1470,7 +1470,7 @@ def __init__(self, dialect: csv.Dialect): super().__init__() self.dialect = dialect - def sniff(self, *_args, **_kwargs): # pylint: disable=signature-differs + def sniff(self, *_args, **_kwargs): # pylint: disable=signature-differs, arguments-differ # return fixed constant dialect, has_header sniffs dialect itself, # so it can't detect headers for a predefined dialect return self.dialect @@ -1838,8 +1838,7 @@ def emitProgressChangedOrCancel(self, current, total): """ if self.cancel: raise TaskState.UserCancelException() - else: - self.__progressChanged.emit(current, total) + self.__progressChanged.emit(current, total) class TextReadWrapper(io.TextIOWrapper): diff --git a/Orange/widgets/utils/textimport.py b/Orange/widgets/utils/textimport.py index be61957f6ec..33042c00bf8 100644 --- a/Orange/widgets/utils/textimport.py +++ b/Orange/widgets/utils/textimport.py @@ -37,7 +37,7 @@ ) from PyQt5.QtCore import ( - Qt, QSize, QPoint, QRect, QRectF, QRegExp, QAbstractTableModel, + Qt, QSize, QRect, QRectF, QRegExp, QAbstractTableModel, QModelIndex, QItemSelectionModel, QTextBoundaryFinder, QTimer, QEvent ) from PyQt5.QtCore import pyqtSignal as Signal, pyqtSlot as Slot