From a56690bc0845300b8f4f50ba2ec76cc0f86fd14c Mon Sep 17 00:00:00 2001 From: Matt Krump <1036969+mkrump@users.noreply.github.com> Date: Thu, 30 Jul 2020 16:49:05 -0600 Subject: [PATCH] Turn on check_untyped_defs for aqt.webview --- qt/aqt/qt.py | 1 + qt/aqt/webview.py | 4 ++-- qt/mypy.ini | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qt/aqt/qt.py b/qt/aqt/qt.py index 9c5dffc0e..3ce6e2fca 100644 --- a/qt/aqt/qt.py +++ b/qt/aqt/qt.py @@ -13,6 +13,7 @@ from PyQt5.Qt import * # type: ignore from PyQt5.QtCore import * from PyQt5.QtCore import pyqtRemoveInputHook # pylint: disable=no-name-in-module from PyQt5.QtGui import * # type: ignore +from PyQt5.QtWebChannel import QWebChannel from PyQt5.QtWebEngineWidgets import * from PyQt5.QtWidgets import * diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 88b5b3a40..8220e26d7 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -30,9 +30,9 @@ class AnkiWebPage(QWebEnginePage): self._setupBridge() self.open_links_externally = True - def _setupBridge(self): + def _setupBridge(self) -> None: class Bridge(QObject): - @pyqtSlot(str, result=str) + @pyqtSlot(str, result=str) # type: ignore def cmd(self, str): return json.dumps(self.onCmd(str)) diff --git a/qt/mypy.ini b/qt/mypy.ini index 9adcb3d1b..ed6253bc7 100644 --- a/qt/mypy.ini +++ b/qt/mypy.ini @@ -88,3 +88,5 @@ check_untyped_defs=true check_untyped_defs=true [mypy-aqt.modelchooser] check_untyped_defs=true +[mypy-aqt.webview] +check_untyped_defs=true