|
40 | 40 | ) |
41 | 41 | from PyQt5.QtWidgets import ( |
42 | 42 | QLabel, QComboBox, QPushButton, QDialog, QDialogButtonBox, QGridLayout, |
43 | | - QVBoxLayout, QSizePolicy, QStyle, QFileIconProvider, QFileDialog, |
44 | | - QApplication, QMessageBox, QTextBrowser, QMenu |
| 43 | + QVBoxLayout, QSizePolicy, QFileIconProvider, QFileDialog, |
| 44 | + QApplication, QMessageBox, QTextBrowser |
45 | 45 | ) |
46 | 46 | from PyQt5.QtCore import pyqtSlot as Slot, pyqtSignal as Signal |
47 | 47 |
|
@@ -956,7 +956,7 @@ def _path_must_be_relative_mb(self, prefix: str) -> QMessageBox: |
956 | 956 | return mb |
957 | 957 |
|
958 | 958 | @Slot() |
959 | | - def browse(self, prefixname=None, directory=None): |
| 959 | + def browse(self): |
960 | 960 | """ |
961 | 961 | Open a file dialog and select a user specified file. |
962 | 962 | """ |
@@ -984,7 +984,7 @@ def browse(self, prefixname=None, directory=None): |
984 | 984 | if not mtype.inherits("text/plain"): |
985 | 985 | mb = self._might_be_binary_mb(path) |
986 | 986 | if mb.exec() == QMessageBox.Cancel: |
987 | | - return |
| 987 | + return False |
988 | 988 | # initialize dialect based on selected format |
989 | 989 | dialect, header = default_options_for_mime_type( |
990 | 990 | path, selected_filter.mime_type, |
@@ -1470,7 +1470,7 @@ def __init__(self, dialect: csv.Dialect): |
1470 | 1470 | super().__init__() |
1471 | 1471 | self.dialect = dialect |
1472 | 1472 |
|
1473 | | - def sniff(self, *_args, **_kwargs): # pylint: disable=signature-differs |
| 1473 | + def sniff(self, *_args, **_kwargs): # pylint: disable=signature-differs, arguments-differ |
1474 | 1474 | # return fixed constant dialect, has_header sniffs dialect itself, |
1475 | 1475 | # so it can't detect headers for a predefined dialect |
1476 | 1476 | return self.dialect |
@@ -1838,8 +1838,7 @@ def emitProgressChangedOrCancel(self, current, total): |
1838 | 1838 | """ |
1839 | 1839 | if self.cancel: |
1840 | 1840 | raise TaskState.UserCancelException() |
1841 | | - else: |
1842 | | - self.__progressChanged.emit(current, total) |
| 1841 | + self.__progressChanged.emit(current, total) |
1843 | 1842 |
|
1844 | 1843 |
|
1845 | 1844 | class TextReadWrapper(io.TextIOWrapper): |
|
0 commit comments