Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
irgolic committed Jan 7, 2021
1 parent f2bbb02 commit 1e8269e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
13 changes: 6 additions & 7 deletions Orange/widgets/data/owcsvimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
5 changes: 2 additions & 3 deletions Orange/widgets/utils/textimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1127,7 +1127,6 @@ def __generate_type_columns_menu(self, columns, menu=None):
current = None
cb = self.column_type_edit_cb
g = QActionGroup(menu)
current_action = None
# 'Copy' the column types model into a menu
for i in range(cb.count()):
if cb.itemData(i, Qt.AccessibleDescriptionRole) == "separator":
Expand All @@ -1139,7 +1138,6 @@ def __generate_type_columns_menu(self, columns, menu=None):
ac.setCheckable(True)
if ac.data() == current:
ac.setChecked(True)
current_action = ac
g.addAction(ac)

def update_types(action):
Expand Down Expand Up @@ -1478,6 +1476,7 @@ def columntype_for_vartype(vartype):
return ColumnType.Text
if vartype == TimeVariable:
return ColumnType.Time
raise ValueError


class SkipItemDelegate(PreviewItemDelegate):
Expand Down

0 comments on commit 1e8269e

Please sign in to comment.