From bb81f921ff9881ce85ef1e4181817b2b78740d1d Mon Sep 17 00:00:00 2001 From: lordwelch Date: Thu, 19 May 2022 22:29:46 -0700 Subject: [PATCH] Fix Qt typing references to strings --- comictaggerlib/comicvinetalker.py | 4 ++-- comictaggerlib/imagefetcher.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/comictaggerlib/comicvinetalker.py b/comictaggerlib/comicvinetalker.py index b58a6be..56d6242 100644 --- a/comictaggerlib/comicvinetalker.py +++ b/comictaggerlib/comicvinetalker.py @@ -736,7 +736,7 @@ class ComicVineTalker: self.nam.finished.connect(self.async_fetch_issue_cover_url_complete) self.nam.get(QtNetwork.QNetworkRequest(QtCore.QUrl(issue_url))) - def async_fetch_issue_cover_url_complete(self, reply: QtNetwork.QNetworkReply) -> None: + def async_fetch_issue_cover_url_complete(self, reply: "QtNetwork.QNetworkReply") -> None: # read in the response data = reply.readAll() @@ -772,7 +772,7 @@ class ComicVineTalker: self.nam.finished.connect(self.async_fetch_alternate_cover_urls_complete) self.nam.get(QtNetwork.QNetworkRequest(QtCore.QUrl(str(issue_page_url)))) - def async_fetch_alternate_cover_urls_complete(self, reply: QtNetwork.QNetworkReply) -> None: + def async_fetch_alternate_cover_urls_complete(self, reply: "QtNetwork.QNetworkReply") -> None: # read in the response html = str(reply.readAll()) alt_cover_url_list = self.parse_out_alt_cover_urls(html) diff --git a/comictaggerlib/imagefetcher.py b/comictaggerlib/imagefetcher.py index 41b02b7..8e0366f 100644 --- a/comictaggerlib/imagefetcher.py +++ b/comictaggerlib/imagefetcher.py @@ -41,7 +41,7 @@ class ImageFetcherException(Exception): pass -def fetch_complete(image_data: Union[bytes, QtCore.QByteArray]) -> None: +def fetch_complete(image_data: "Union[bytes, QtCore.QByteArray]") -> None: ... @@ -106,7 +106,7 @@ class ImageFetcher: # we'll get called back when done... return bytes() - def finish_request(self, reply: QtNetwork.QNetworkReply) -> None: + def finish_request(self, reply: "QtNetwork.QNetworkReply") -> None: # read in the image data logger.debug("request finished") image_data = reply.readAll() @@ -134,7 +134,7 @@ class ImageFetcher: cur.execute("CREATE TABLE Images(url TEXT,filename TEXT,timestamp TEXT,PRIMARY KEY (url))") - def add_image_to_cache(self, url: str, image_data: Union[bytes, QtCore.QByteArray]) -> None: + def add_image_to_cache(self, url: str, image_data: "Union[bytes, QtCore.QByteArray]") -> None: con = lite.connect(self.db_file)