From 3948b778e80823ba9ea4ee79a743cfae68a0abc1 Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Wed, 4 Mar 2020 17:41:26 +0100 Subject: [PATCH] Type-annotate editor.card --- qt/aqt/browser.py | 2 +- qt/aqt/editor.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index ecdcbe1ab..280d18099 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -868,7 +868,7 @@ QTableView {{ gridline-color: {grid} }} else: self.editor.setNote(self.card.note(reload=True), focusTo=self.focusTo) self.focusTo = None - self.editor.card = self.card # type: ignore + self.editor.card = self.card self.singleCard = True self._updateFlagsMenu() gui_hooks.browser_did_change_row(self) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 0ef34eb2b..74e52fa09 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -19,6 +19,7 @@ from bs4 import BeautifulSoup import aqt import aqt.sound +from anki.cards import Card from anki.hooks import runFilter from anki.httpclient import HttpClient from anki.lang import _ @@ -77,7 +78,7 @@ class Editor: self.addMode = addMode self.currentField: Optional[int] = None # current card, for card layout - self.card = None + self.card: Optional[Card] = None self.setupOuter() self.setupWeb() self.setupShortcuts()