mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
fix qt/ pylints
This commit is contained in:
parent
ac923b5232
commit
b30b7c3073
10 changed files with 17 additions and 23 deletions
|
@ -113,6 +113,8 @@ prefix = """\
|
||||||
# This file is automatically generated; edit tools/genhooks.py instead.
|
# This file is automatically generated; edit tools/genhooks.py instead.
|
||||||
# Please import from anki.hooks instead of this file.
|
# Please import from anki.hooks instead of this file.
|
||||||
|
|
||||||
|
# pylint: disable=unused-import
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, List, Sequence, Tuple
|
from typing import Any, Callable, List, Sequence, Tuple
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
[MASTER]
|
[MASTER]
|
||||||
persistent = no
|
persistent = no
|
||||||
extension-pkg-whitelist=PyQt5
|
extension-pkg-whitelist=PyQt5
|
||||||
ignore = forms
|
ignore = forms,hooks_gen.py
|
||||||
|
|
||||||
[TYPECHECK]
|
[TYPECHECK]
|
||||||
ignored-modules=win32file,pywintypes,socket,win32pipe
|
ignored-modules=win32file,pywintypes,socket,win32pipe,winrt
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
output-format=colorized
|
output-format=colorized
|
||||||
|
|
|
@ -21,7 +21,7 @@ from anki.consts import *
|
||||||
from anki.lang import without_unicode_isolation
|
from anki.lang import without_unicode_isolation
|
||||||
from anki.models import NoteType
|
from anki.models import NoteType
|
||||||
from anki.notes import Note
|
from anki.notes import Note
|
||||||
from anki.rsbackend import TR, DeckTreeNode, InvalidInput, pb
|
from anki.rsbackend import DeckTreeNode, InvalidInput, pb
|
||||||
from anki.stats import CardStats
|
from anki.stats import CardStats
|
||||||
from anki.utils import htmlToTextLine, ids2str, isMac, isWin
|
from anki.utils import htmlToTextLine, ids2str, isMac, isWin
|
||||||
from aqt import AnkiQt, gui_hooks
|
from aqt import AnkiQt, gui_hooks
|
||||||
|
@ -1235,11 +1235,15 @@ QTableView {{ gridline-color: {grid} }}
|
||||||
)
|
)
|
||||||
elif mods & Qt.ControlModifier:
|
elif mods & Qt.ControlModifier:
|
||||||
txt = self.col.backend.concatenate_searches(
|
txt = self.col.backend.concatenate_searches(
|
||||||
sep=pb.ConcatenateSearchesIn.Separator.AND, searches=[cur, txt]
|
# pylint: disable=no-member
|
||||||
|
sep=pb.ConcatenateSearchesIn.Separator.AND,
|
||||||
|
searches=[cur, txt],
|
||||||
)
|
)
|
||||||
elif mods & Qt.ShiftModifier:
|
elif mods & Qt.ShiftModifier:
|
||||||
txt = self.col.backend.concatenate_searches(
|
txt = self.col.backend.concatenate_searches(
|
||||||
sep=pb.ConcatenateSearchesIn.Separator.OR, searches=[cur, txt]
|
# pylint: disable=no-member
|
||||||
|
sep=pb.ConcatenateSearchesIn.Separator.OR,
|
||||||
|
searches=[cur, txt],
|
||||||
)
|
)
|
||||||
except InvalidInput as e:
|
except InvalidInput as e:
|
||||||
showWarning(str(e))
|
showWarning(str(e))
|
||||||
|
|
|
@ -9,8 +9,7 @@ from dataclasses import dataclass
|
||||||
|
|
||||||
import aqt
|
import aqt
|
||||||
from anki.errors import DeckRenameError
|
from anki.errors import DeckRenameError
|
||||||
from anki.rsbackend import TR, DeckTreeNode
|
from anki.rsbackend import DeckTreeNode
|
||||||
from anki.utils import ids2str
|
|
||||||
from aqt import AnkiQt, gui_hooks
|
from aqt import AnkiQt, gui_hooks
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
from aqt.sound import av_player
|
from aqt.sound import av_player
|
||||||
|
|
|
@ -23,7 +23,7 @@ from anki.cards import Card
|
||||||
from anki.hooks import runFilter
|
from anki.hooks import runFilter
|
||||||
from anki.httpclient import HttpClient
|
from anki.httpclient import HttpClient
|
||||||
from anki.notes import Note
|
from anki.notes import Note
|
||||||
from anki.utils import checksum, isLin, isWin, namedtmp, stripHTMLMedia
|
from anki.utils import checksum, isLin, isWin, namedtmp
|
||||||
from aqt import AnkiQt, gui_hooks
|
from aqt import AnkiQt, gui_hooks
|
||||||
from aqt.main import ResetReason
|
from aqt.main import ResetReason
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
|
|
|
@ -7,7 +7,5 @@ See pylib/anki/hooks.py
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
|
||||||
|
|
||||||
# You can find the definitions in ../tools/genhooks_gui.py
|
# You can find the definitions in ../tools/genhooks_gui.py
|
||||||
from aqt.hooks_gen import *
|
from aqt.hooks_gen import *
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import enum
|
|
||||||
import io
|
import io
|
||||||
import locale
|
|
||||||
import pickle
|
import pickle
|
||||||
import random
|
import random
|
||||||
import shutil
|
import shutil
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import re
|
|
||||||
from concurrent.futures import Future
|
from concurrent.futures import Future
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
|
@ -526,7 +526,6 @@ class Recorder(ABC):
|
||||||
|
|
||||||
def on_timer(self):
|
def on_timer(self):
|
||||||
"Will be called periodically."
|
"Will be called periodically."
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# QAudioInput recording
|
# QAudioInput recording
|
||||||
|
@ -540,12 +539,7 @@ class QtAudioInputRecorder(Recorder):
|
||||||
self.mw = mw
|
self.mw = mw
|
||||||
self._parent = parent
|
self._parent = parent
|
||||||
|
|
||||||
from PyQt5.QtMultimedia import (
|
from PyQt5.QtMultimedia import QAudioDeviceInfo, QAudioFormat, QAudioInput
|
||||||
QAudio,
|
|
||||||
QAudioDeviceInfo,
|
|
||||||
QAudioFormat,
|
|
||||||
QAudioInput,
|
|
||||||
)
|
|
||||||
|
|
||||||
format = QAudioFormat()
|
format = QAudioFormat()
|
||||||
format.setChannelCount(1)
|
format.setChannelCount(1)
|
||||||
|
@ -776,7 +770,7 @@ class RecordDialog(QDialog):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._save_diag()
|
self._save_diag()
|
||||||
self._recorder.stop(lambda out: self._on_success(out))
|
self._recorder.stop(self._on_success)
|
||||||
finally:
|
finally:
|
||||||
QDialog.accept(self)
|
QDialog.accept(self)
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import PyQt5
|
|
||||||
import multiprocessing
|
|
||||||
|
|
||||||
|
import PyQt5
|
||||||
from pylint.lint import Run
|
from pylint.lint import Run
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue