Fix remaining new flake8 issues
This commit is contained in:
parent
7c87f4e3d0
commit
2d996baea0
@ -91,15 +91,15 @@ def _parse_yaml_type(
|
|||||||
) -> configtypes.BaseType:
|
) -> configtypes.BaseType:
|
||||||
if isinstance(node, str):
|
if isinstance(node, str):
|
||||||
# e.g:
|
# e.g:
|
||||||
# type: Bool
|
# > type: Bool
|
||||||
# -> create the type object without any arguments
|
# -> create the type object without any arguments
|
||||||
type_name = node
|
type_name = node
|
||||||
kwargs = {} # type: typing.MutableMapping[str, typing.Any]
|
kwargs = {} # type: typing.MutableMapping[str, typing.Any]
|
||||||
elif isinstance(node, dict):
|
elif isinstance(node, dict):
|
||||||
# e.g:
|
# e.g:
|
||||||
# type:
|
# > type:
|
||||||
# name: String
|
# > name: String
|
||||||
# none_ok: true
|
# > none_ok: true
|
||||||
# -> create the type object and pass arguments
|
# -> create the type object and pass arguments
|
||||||
type_name = node.pop('name')
|
type_name = node.pop('name')
|
||||||
kwargs = node
|
kwargs = node
|
||||||
|
@ -31,7 +31,7 @@ except ImportError: # pragma: no cover
|
|||||||
try:
|
try:
|
||||||
# Python2
|
# Python2
|
||||||
from Tkinter import Tk # type: ignore
|
from Tkinter import Tk # type: ignore
|
||||||
import tkMessageBox as messagebox # type: ignore
|
import tkMessageBox as messagebox # type: ignore # noqa: N813
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Some Python without Tk
|
# Some Python without Tk
|
||||||
Tk = None # type: ignore
|
Tk = None # type: ignore
|
||||||
|
@ -40,7 +40,7 @@ from PyQt5.QtCore import (qVersion, QEventLoop, QDataStream, QByteArray,
|
|||||||
try:
|
try:
|
||||||
from PyQt5.QtWebKit import qWebKitVersion
|
from PyQt5.QtWebKit import qWebKitVersion
|
||||||
except ImportError: # pragma: no cover
|
except ImportError: # pragma: no cover
|
||||||
qWebKitVersion = None # type: ignore
|
qWebKitVersion = None # type: ignore # noqa: N816
|
||||||
|
|
||||||
|
|
||||||
MAXVALS = {
|
MAXVALS = {
|
||||||
|
@ -42,7 +42,7 @@ from PyQt5.QtWidgets import QApplication
|
|||||||
try:
|
try:
|
||||||
from PyQt5.QtWebKit import qWebKitVersion
|
from PyQt5.QtWebKit import qWebKitVersion
|
||||||
except ImportError: # pragma: no cover
|
except ImportError: # pragma: no cover
|
||||||
qWebKitVersion = None # type: ignore
|
qWebKitVersion = None # type: ignore # noqa: N816
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PyQt5.QtWebEngineWidgets import QWebEngineProfile
|
from PyQt5.QtWebEngineWidgets import QWebEngineProfile
|
||||||
|
@ -41,7 +41,7 @@ def test_first_last_item(counts):
|
|||||||
cat = mock.Mock(spec=['layoutChanged', 'layoutAboutToBeChanged'])
|
cat = mock.Mock(spec=['layoutChanged', 'layoutAboutToBeChanged'])
|
||||||
cat.rowCount = mock.Mock(return_value=c, spec=[])
|
cat.rowCount = mock.Mock(return_value=c, spec=[])
|
||||||
model.add_category(cat)
|
model.add_category(cat)
|
||||||
data = [i for i, rowCount in enumerate(counts) if rowCount > 0]
|
data = [i for i, row_count in enumerate(counts) if row_count > 0]
|
||||||
if not data:
|
if not data:
|
||||||
# with no items, first and last should be an invalid index
|
# with no items, first and last should be an invalid index
|
||||||
assert not model.first_item().isValid()
|
assert not model.first_item().isValid()
|
||||||
|
@ -98,7 +98,7 @@ class FakeSocket(QObject):
|
|||||||
_connect_successful: The value returned for waitForConnected().
|
_connect_successful: The value returned for waitForConnected().
|
||||||
"""
|
"""
|
||||||
|
|
||||||
readyRead = pyqtSignal()
|
readyRead = pyqtSignal() # noqa: N815
|
||||||
disconnected = pyqtSignal()
|
disconnected = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self, *, error=QLocalSocket.UnknownSocketError, state=None,
|
def __init__(self, *, error=QLocalSocket.UnknownSocketError, state=None,
|
||||||
|
Loading…
Reference in New Issue
Block a user