Remove unused imports
This commit is contained in:
parent
2483ef4517
commit
22a5db8ace
@ -3,16 +3,16 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pprint
|
||||
import copy
|
||||
import pprint
|
||||
from typing import Any, List, Optional, Sequence, Tuple
|
||||
|
||||
import anki # pylint: disable=unused-import
|
||||
import anki._backend.backend_pb2 as _pb
|
||||
from anki import hooks
|
||||
from anki.consts import MODEL_STD
|
||||
from anki.models import NoteType
|
||||
from anki.utils import joinFields
|
||||
from anki.consts import MODEL_STD
|
||||
|
||||
|
||||
class Note:
|
||||
@ -77,16 +77,16 @@ class Note:
|
||||
def joinedFields(self) -> str:
|
||||
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.ord = ord
|
||||
card.did = 1
|
||||
|
||||
model = self.model()
|
||||
template = copy.copy(
|
||||
model["tmpls"][ord]
|
||||
if model["type"] == MODEL_STD
|
||||
else model["tmpls"][0]
|
||||
model["tmpls"][ord] if model["type"] == MODEL_STD else model["tmpls"][0]
|
||||
)
|
||||
# may differ in cloze case
|
||||
template["ord"] = card.ord
|
||||
|
@ -1,19 +1,16 @@
|
||||
# Copyright: Ankitects Pty Ltd and contributors
|
||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
import copy
|
||||
import json
|
||||
import re
|
||||
from concurrent.futures import Future
|
||||
from typing import Any, Dict, List, Match, Optional
|
||||
|
||||
import aqt
|
||||
from anki.cards import Card
|
||||
from anki.consts import *
|
||||
from anki.errors import TemplateError
|
||||
from anki.lang import without_unicode_isolation
|
||||
from anki.notes import Note
|
||||
from anki.template import TemplateRenderContext
|
||||
from aqt import AnkiQt, gui_hooks
|
||||
from aqt.forms.browserdisp import Ui_Dialog
|
||||
from aqt.qt import *
|
||||
|
Loading…
Reference in New Issue
Block a user