From c023bdd78e0e2e5e4bd65d68fd6eca1c396be9f1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 20 Apr 2020 13:15:23 +1000 Subject: [PATCH] fix adding deck configs --- qt/aqt/deckconf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qt/aqt/deckconf.py b/qt/aqt/deckconf.py index 0241fe26d..fdeec50f6 100644 --- a/qt/aqt/deckconf.py +++ b/qt/aqt/deckconf.py @@ -1,8 +1,9 @@ # Copyright: Ankitects Pty Ltd and contributors # -*- coding: utf-8 -*- # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + from operator import itemgetter -from typing import Union +from typing import Dict, Union import aqt from anki.consts import NEW_CARDS_RANDOM @@ -22,7 +23,7 @@ from aqt.utils import ( class DeckConf(QDialog): - def __init__(self, mw, deck): + def __init__(self, mw: aqt.AnkiQt, deck: Dict): QDialog.__init__(self, mw) self.mw = mw self.deck = deck @@ -117,14 +118,14 @@ class DeckConf(QDialog): txt = "" self.form.count.setText(txt) - def addGroup(self): + def addGroup(self) -> None: name = getOnlyText(_("New options group name:")) if not name: return # first, save currently entered data to current conf self.saveConf() # then clone the conf - id = self.mw.col.decks.add_config_returning_id(name, cloneFrom=self.conf) + id = self.mw.col.decks.add_config_returning_id(name, clone_from=self.conf) # set the deck to the new conf self.deck["conf"] = id # then reload the conf list