new stubs don't require as many ignores

This commit is contained in:
Damien Elmes 2020-06-02 17:56:15 +10:00
parent 2a52314d58
commit 59bbf02364
2 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,7 @@ from PyQt5.Qt import * # type: ignore
from PyQt5.QtCore import * from PyQt5.QtCore import *
from PyQt5.QtCore import pyqtRemoveInputHook # pylint: disable=no-name-in-module from PyQt5.QtCore import pyqtRemoveInputHook # pylint: disable=no-name-in-module
from PyQt5.QtGui import * # type: ignore from PyQt5.QtGui import * # type: ignore
from PyQt5.QtWebEngineWidgets import * # type: ignore from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import *
from anki.utils import isMac, isWin from anki.utils import isMac, isWin

View File

@ -21,7 +21,7 @@ serverbaseurl = re.compile(r"^.+:\/\/[^\/]+")
########################################################################## ##########################################################################
class AnkiWebPage(QWebEnginePage): # type: ignore class AnkiWebPage(QWebEnginePage):
def __init__(self, onBridgeCmd): def __init__(self, onBridgeCmd):
QWebEnginePage.__init__(self) QWebEnginePage.__init__(self)
self._onBridgeCmd = onBridgeCmd self._onBridgeCmd = onBridgeCmd
@ -183,12 +183,12 @@ class WebContent:
########################################################################## ##########################################################################
class AnkiWebView(QWebEngineView): # type: ignore class AnkiWebView(QWebEngineView):
def __init__( def __init__(
self, parent: Optional[QWidget] = None, title: str = "default" self, parent: Optional[QWidget] = None, title: str = "default"
) -> None: ) -> None:
QWebEngineView.__init__(self, parent=parent) # type: ignore QWebEngineView.__init__(self, parent=parent)
self.title = title self.title = title # type: ignore
self._page = AnkiWebPage(self._onBridgeCmd) self._page = AnkiWebPage(self._onBridgeCmd)
self._page.setBackgroundColor(self._getWindowColor()) # reduce flicker self._page.setBackgroundColor(self._getWindowColor()) # reduce flicker
@ -200,7 +200,7 @@ class AnkiWebView(QWebEngineView): # type: ignore
self.requiresCol = True self.requiresCol = True
self.setPage(self._page) self.setPage(self._page)
self._page.profile().setHttpCacheType(QWebEngineProfile.NoCache) # type: ignore self._page.profile().setHttpCacheType(QWebEngineProfile.NoCache)
self.resetHandlers() self.resetHandlers()
self.allowDrops = False self.allowDrops = False
self._filterSet = False self._filterSet = False
@ -278,7 +278,7 @@ class AnkiWebView(QWebEngineView): # type: ignore
def dropEvent(self, evt): def dropEvent(self, evt):
pass pass
def setHtml(self, html: str) -> None: def setHtml(self, html: str) -> None: # type: ignore
# discard any previous pending actions # discard any previous pending actions
self._pendingActions = [] self._pendingActions = []
self._domDone = True self._domDone = True