From 59bbf02364c8eb2aad442f7af3d4de138266a2a0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 2 Jun 2020 17:56:15 +1000 Subject: [PATCH] new stubs don't require as many ignores --- qt/aqt/qt.py | 2 +- qt/aqt/webview.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qt/aqt/qt.py b/qt/aqt/qt.py index a9557c28d..9c5dffc0e 100644 --- a/qt/aqt/qt.py +++ b/qt/aqt/qt.py @@ -13,7 +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.QtWebEngineWidgets import * # type: ignore +from PyQt5.QtWebEngineWidgets import * from PyQt5.QtWidgets import * from anki.utils import isMac, isWin diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 0fe602893..df8da3db3 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -21,7 +21,7 @@ serverbaseurl = re.compile(r"^.+:\/\/[^\/]+") ########################################################################## -class AnkiWebPage(QWebEnginePage): # type: ignore +class AnkiWebPage(QWebEnginePage): def __init__(self, onBridgeCmd): QWebEnginePage.__init__(self) self._onBridgeCmd = onBridgeCmd @@ -183,12 +183,12 @@ class WebContent: ########################################################################## -class AnkiWebView(QWebEngineView): # type: ignore +class AnkiWebView(QWebEngineView): def __init__( self, parent: Optional[QWidget] = None, title: str = "default" ) -> None: - QWebEngineView.__init__(self, parent=parent) # type: ignore - self.title = title + QWebEngineView.__init__(self, parent=parent) + self.title = title # type: ignore self._page = AnkiWebPage(self._onBridgeCmd) self._page.setBackgroundColor(self._getWindowColor()) # reduce flicker @@ -200,7 +200,7 @@ class AnkiWebView(QWebEngineView): # type: ignore self.requiresCol = True self.setPage(self._page) - self._page.profile().setHttpCacheType(QWebEngineProfile.NoCache) # type: ignore + self._page.profile().setHttpCacheType(QWebEngineProfile.NoCache) self.resetHandlers() self.allowDrops = False self._filterSet = False @@ -278,7 +278,7 @@ class AnkiWebView(QWebEngineView): # type: ignore def dropEvent(self, evt): pass - def setHtml(self, html: str) -> None: + def setHtml(self, html: str) -> None: # type: ignore # discard any previous pending actions self._pendingActions = [] self._domDone = True