From c839cda19ff189faef3c19adfaa75c99aded81eb Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Wed, 12 Feb 2020 22:15:44 +0100 Subject: [PATCH] Fix missing "Optional" import and lint --- qt/aqt/browser.py | 1 + qt/aqt/clayout.py | 10 ++++++++-- qt/aqt/gui_hooks.py | 2 +- qt/aqt/toolbar.py | 6 ++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index a43fa45f3..5e8220ace 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -2478,6 +2478,7 @@ Are you sure you want to continue?""" # Card Info Dialog ###################################################################### + class CardInfoDialog(QDialog): silentlyClose = True diff --git a/qt/aqt/clayout.py b/qt/aqt/clayout.py index 9a01bcbe1..5dbc9ce90 100644 --- a/qt/aqt/clayout.py +++ b/qt/aqt/clayout.py @@ -215,10 +215,16 @@ class CardLayout(QDialog): "_anki/reviewer.js", ] pform.frontWeb.stdHtml( - self.mw.reviewer.revHtml(), css=["_anki/reviewer.css"], js=jsinc, context=self + self.mw.reviewer.revHtml(), + css=["_anki/reviewer.css"], + js=jsinc, + context=self, ) pform.backWeb.stdHtml( - self.mw.reviewer.revHtml(), css=["_anki/reviewer.css"], js=jsinc, context=self + self.mw.reviewer.revHtml(), + css=["_anki/reviewer.css"], + js=jsinc, + context=self, ) pform.frontWeb.set_bridge_command(self._on_bridge_cmd, self) pform.backWeb.set_bridge_command(self._on_bridge_cmd, self) diff --git a/qt/aqt/gui_hooks.py b/qt/aqt/gui_hooks.py index 1685b959f..0607930c8 100644 --- a/qt/aqt/gui_hooks.py +++ b/qt/aqt/gui_hooks.py @@ -7,7 +7,7 @@ See pylib/anki/hooks.py from __future__ import annotations -from typing import Any, Callable, Dict, List, Tuple +from typing import Any, Callable, Dict, List, Optional, Tuple import anki import aqt diff --git a/qt/aqt/toolbar.py b/qt/aqt/toolbar.py index 28a0a0222..a7ce013e2 100644 --- a/qt/aqt/toolbar.py +++ b/qt/aqt/toolbar.py @@ -4,7 +4,7 @@ from __future__ import annotations -from typing import Optional, Any +from typing import Any, Optional import aqt from anki.lang import _ @@ -49,7 +49,9 @@ class Toolbar: link_handler = link_handler or self._linkHandler self.web.set_bridge_command(link_handler, web_context) self.web.stdHtml( - self._body % self._centerLinks(), css=["_anki/toolbar.css"], context=web_context + self._body % self._centerLinks(), + css=["_anki/toolbar.css"], + context=web_context, ) self.web.adjustHeightToFit()