Fix missing "Optional" import and lint

This commit is contained in:
Glutanimate 2020-02-12 22:15:44 +01:00
parent 5bd38ce0a5
commit c839cda19f
4 changed files with 14 additions and 5 deletions

View File

@ -2478,6 +2478,7 @@ Are you sure you want to continue?"""
# Card Info Dialog
######################################################################
class CardInfoDialog(QDialog):
silentlyClose = True

View File

@ -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)

View File

@ -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

View File

@ -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()