Remove unused imports

This commit is contained in:
Henrik Giesel 2021-02-02 17:01:25 +01:00
parent 2483ef4517
commit 22a5db8ace
2 changed files with 6 additions and 9 deletions

View File

@ -3,16 +3,16 @@
from __future__ import annotations from __future__ import annotations
import pprint
import copy import copy
import pprint
from typing import Any, List, Optional, Sequence, Tuple from typing import Any, List, Optional, Sequence, Tuple
import anki # pylint: disable=unused-import import anki # pylint: disable=unused-import
import anki._backend.backend_pb2 as _pb import anki._backend.backend_pb2 as _pb
from anki import hooks from anki import hooks
from anki.consts import MODEL_STD
from anki.models import NoteType from anki.models import NoteType
from anki.utils import joinFields from anki.utils import joinFields
from anki.consts import MODEL_STD
class Note: class Note:
@ -77,16 +77,16 @@ class Note:
def joinedFields(self) -> str: def joinedFields(self) -> str:
return joinFields(self.fields) return joinFields(self.fields)
def ephemeral_card(self, ord=0, *, fill_empty=False) -> anki.cards.Card: def ephemeral_card(
self, ord: int = 0, *, fill_empty: bool = False
) -> anki.cards.Card:
card = anki.cards.Card(self.col) card = anki.cards.Card(self.col)
card.ord = ord card.ord = ord
card.did = 1 card.did = 1
model = self.model() model = self.model()
template = copy.copy( template = copy.copy(
model["tmpls"][ord] model["tmpls"][ord] if model["type"] == MODEL_STD else model["tmpls"][0]
if model["type"] == MODEL_STD
else model["tmpls"][0]
) )
# may differ in cloze case # may differ in cloze case
template["ord"] = card.ord template["ord"] = card.ord

View File

@ -1,19 +1,16 @@
# Copyright: Ankitects Pty Ltd and contributors # Copyright: Ankitects Pty Ltd and contributors
# 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
import copy
import json import json
import re import re
from concurrent.futures import Future from concurrent.futures import Future
from typing import Any, Dict, List, Match, Optional from typing import Any, Dict, List, Match, Optional
import aqt import aqt
from anki.cards import Card
from anki.consts import * from anki.consts import *
from anki.errors import TemplateError from anki.errors import TemplateError
from anki.lang import without_unicode_isolation from anki.lang import without_unicode_isolation
from anki.notes import Note from anki.notes import Note
from anki.template import TemplateRenderContext
from aqt import AnkiQt, gui_hooks from aqt import AnkiQt, gui_hooks
from aqt.forms.browserdisp import Ui_Dialog from aqt.forms.browserdisp import Ui_Dialog
from aqt.qt import * from aqt.qt import *