From 22a5db8acef08a942fb797bb52052fdd5735b85b Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Tue, 2 Feb 2021 17:01:25 +0100 Subject: [PATCH] Remove unused imports --- pylib/anki/notes.py | 12 ++++++------ qt/aqt/clayout.py | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pylib/anki/notes.py b/pylib/anki/notes.py index 936e72d3b..a9be4f69a 100644 --- a/pylib/anki/notes.py +++ b/pylib/anki/notes.py @@ -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 diff --git a/qt/aqt/clayout.py b/qt/aqt/clayout.py index cdd3ab8bd..041e4f031 100644 --- a/qt/aqt/clayout.py +++ b/qt/aqt/clayout.py @@ -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 *