mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Merge branch 'master' into help-wanted-4-add-type-hints-3
This commit is contained in:
commit
b3ec8046bf
2 changed files with 9 additions and 5 deletions
|
@ -3,7 +3,9 @@
|
||||||
# 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 operator import itemgetter
|
from operator import itemgetter
|
||||||
from typing import Dict, Union
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
from PyQt5.QtWidgets import QLineEdit
|
||||||
|
|
||||||
import aqt
|
import aqt
|
||||||
from anki.consts import NEW_CARDS_RANDOM
|
from anki.consts import NEW_CARDS_RANDOM
|
||||||
|
@ -257,14 +259,14 @@ class DeckConf(QDialog):
|
||||||
# Saving
|
# Saving
|
||||||
##################################################
|
##################################################
|
||||||
|
|
||||||
def updateList(self, conf, key, w, minSize=1):
|
def updateList(self, conf: Any, key: str, w: QLineEdit, minSize: int = 1) -> None:
|
||||||
items = str(w.text()).split(" ")
|
items = str(w.text()).split(" ")
|
||||||
ret = []
|
ret = []
|
||||||
for i in items:
|
for item in items:
|
||||||
if not i:
|
if not item:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
i = float(i)
|
i = float(item)
|
||||||
assert i > 0
|
assert i > 0
|
||||||
if i == int(i):
|
if i == int(i):
|
||||||
i = int(i)
|
i = int(i)
|
||||||
|
|
|
@ -74,3 +74,5 @@ check_untyped_defs=true
|
||||||
check_untyped_defs=true
|
check_untyped_defs=true
|
||||||
[mypy-aqt.importing]
|
[mypy-aqt.importing]
|
||||||
check_untyped_defs=true
|
check_untyped_defs=true
|
||||||
|
[mypy-aqt.deckconf]
|
||||||
|
check_untyped_defs=true
|
||||||
|
|
Loading…
Reference in a new issue