Remove unused attributes

This commit is contained in:
Timmy Welch 2024-07-27 19:22:54 -07:00
parent a7a9d38428
commit 0048901a61
12 changed files with 14 additions and 28 deletions

View File

@ -54,13 +54,13 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
self.current_match_set: Result = match_set_list[0]
self.altCoverWidget = CoverImageWidget(
self.altCoverContainer, CoverImageWidget.AltCoverMode, config.Runtime_Options__config.user_cache_dir, talker
self.altCoverContainer, CoverImageWidget.AltCoverMode, config.Runtime_Options__config.user_cache_dir
)
gridlayout = QtWidgets.QGridLayout(self.altCoverContainer)
gridlayout.addWidget(self.altCoverWidget)
gridlayout.setContentsMargins(0, 0, 0, 0)
self.archiveCoverWidget = CoverImageWidget(self.archiveCoverContainer, CoverImageWidget.ArchiveMode, None, None)
self.archiveCoverWidget = CoverImageWidget(self.archiveCoverContainer, CoverImageWidget.ArchiveMode, None)
gridlayout = QtWidgets.QGridLayout(self.archiveCoverContainer)
gridlayout.addWidget(self.archiveCoverWidget)
gridlayout.setContentsMargins(0, 0, 0, 0)

View File

@ -36,14 +36,12 @@ class AutoTagProgressWindow(QtWidgets.QDialog):
self.lblSourceName.setText(talker.attribution)
self.archiveCoverWidget = CoverImageWidget(
self.archiveCoverContainer, CoverImageWidget.DataMode, None, None, False
)
self.archiveCoverWidget = CoverImageWidget(self.archiveCoverContainer, CoverImageWidget.DataMode, None, False)
gridlayout = QtWidgets.QGridLayout(self.archiveCoverContainer)
gridlayout.addWidget(self.archiveCoverWidget)
gridlayout.setContentsMargins(0, 0, 0, 0)
self.testCoverWidget = CoverImageWidget(self.testCoverContainer, CoverImageWidget.DataMode, None, None, False)
self.testCoverWidget = CoverImageWidget(self.testCoverContainer, CoverImageWidget.DataMode, None, False)
gridlayout = QtWidgets.QGridLayout(self.testCoverContainer)
gridlayout.addWidget(self.testCoverWidget)
gridlayout.setContentsMargins(0, 0, 0, 0)

View File

@ -31,7 +31,6 @@ from comictaggerlib.imagepopup import ImagePopup
from comictaggerlib.pageloader import PageLoader
from comictaggerlib.ui import ui_path
from comictaggerlib.ui.qtutils import get_qimage_from_data
from comictalker.comictalker import ComicTalker
logger = logging.getLogger(__name__)
@ -67,7 +66,6 @@ class CoverImageWidget(QtWidgets.QWidget):
parent: QtWidgets.QWidget,
mode: int,
cache_folder: pathlib.Path | None,
talker: ComicTalker | None,
blur: bool = False,
expand_on_click: bool = True,
) -> None:

View File

@ -119,7 +119,6 @@ class IssueIdentifier:
self.progress_callback: Callable[[int, int], None] | None = None
self.cover_url_callback: Callable[[bytes], None] | None = None
self.search_result = self.result_no_matches
self.cover_page_index = 0
self.cancel = False
self.match_list: list[IssueResult] = []

View File

@ -57,7 +57,6 @@ class IssueSelectionWindow(QtWidgets.QDialog):
self.coverImageContainer,
CoverImageWidget.AltCoverMode,
config.Runtime_Options__config.user_cache_dir,
talker,
)
gridlayout = QtWidgets.QGridLayout(self.coverImageContainer)
gridlayout.addWidget(self.coverWidget)
@ -83,7 +82,6 @@ class IssueSelectionWindow(QtWidgets.QDialog):
self.issue_id: str = ""
self.config = config
self.talker = talker
self.url_fetch_thread = None
self.issue_list: dict[str, GenericMetadata] = {}
# Display talker logo and set url
@ -93,7 +91,6 @@ class IssueSelectionWindow(QtWidgets.QDialog):
self.imageIssuesSourceLogo,
CoverImageWidget.URLMode,
config.Runtime_Options__config.user_cache_dir,
talker,
False,
)
self.imageIssuesSourceWidget.showControls = False

View File

@ -46,13 +46,13 @@ class MatchSelectionWindow(QtWidgets.QDialog):
uic.loadUi(uifile, self)
self.altCoverWidget = CoverImageWidget(
self.altCoverContainer, CoverImageWidget.AltCoverMode, config.Runtime_Options__config.user_cache_dir, talker
self.altCoverContainer, CoverImageWidget.AltCoverMode, config.Runtime_Options__config.user_cache_dir
)
gridlayout = QtWidgets.QGridLayout(self.altCoverContainer)
gridlayout.addWidget(self.altCoverWidget)
gridlayout.setContentsMargins(0, 0, 0, 0)
self.archiveCoverWidget = CoverImageWidget(self.archiveCoverContainer, CoverImageWidget.ArchiveMode, None, None)
self.archiveCoverWidget = CoverImageWidget(self.archiveCoverContainer, CoverImageWidget.ArchiveMode, None)
gridlayout = QtWidgets.QGridLayout(self.archiveCoverContainer)
gridlayout.addWidget(self.archiveCoverWidget)
gridlayout.setContentsMargins(0, 0, 0, 0)

View File

@ -35,7 +35,7 @@ class PageBrowserWindow(QtWidgets.QDialog):
with (ui_path / "pagebrowser.ui").open(encoding="utf-8") as uifile:
uic.loadUi(uifile, self)
self.pageWidget = CoverImageWidget(self.pageContainer, CoverImageWidget.ArchiveMode, None, None)
self.pageWidget = CoverImageWidget(self.pageContainer, CoverImageWidget.ArchiveMode, None)
gridlayout = QtWidgets.QGridLayout(self.pageContainer)
gridlayout.addWidget(self.pageWidget)
gridlayout.setContentsMargins(0, 0, 0, 0)

View File

@ -81,7 +81,7 @@ class PageListEditor(QtWidgets.QWidget):
"pages": self,
}
self.pageWidget = CoverImageWidget(self.pageContainer, CoverImageWidget.ArchiveMode, None, None)
self.pageWidget = CoverImageWidget(self.pageContainer, CoverImageWidget.ArchiveMode, None)
gridlayout = QtWidgets.QGridLayout(self.pageContainer)
gridlayout.addWidget(self.pageWidget)
gridlayout.setContentsMargins(0, 0, 0, 0)

View File

@ -106,7 +106,6 @@ class SeriesSelectionWindow(QtWidgets.QDialog):
issue_number: str,
year: int | None,
issue_count: int | None,
cover_index_list: list[int],
comic_archive: ComicArchive | None,
config: ct_ns,
talker: ComicTalker,
@ -119,7 +118,7 @@ class SeriesSelectionWindow(QtWidgets.QDialog):
uic.loadUi(uifile, self)
self.imageWidget = CoverImageWidget(
self.imageContainer, CoverImageWidget.URLMode, config.Runtime_Options__config.user_cache_dir, talker
self.imageContainer, CoverImageWidget.URLMode, config.Runtime_Options__config.user_cache_dir
)
gridlayout = QtWidgets.QGridLayout(self.imageContainer)
gridlayout.addWidget(self.imageWidget)
@ -147,7 +146,6 @@ class SeriesSelectionWindow(QtWidgets.QDialog):
self.series_id: str = ""
self.comic_archive = comic_archive
self.immediate_autoselect = autoselect
self.cover_index_list = cover_index_list
self.series_list: dict[str, ComicSeries] = {}
self.literal = literal
self.ii: IssueIdentifier | None = None
@ -168,7 +166,6 @@ class SeriesSelectionWindow(QtWidgets.QDialog):
self.imageSourceLogo,
CoverImageWidget.URLMode,
config.Runtime_Options__config.user_cache_dir,
talker,
False,
)
self.imageSourceWidget.showControls = False

View File

@ -179,7 +179,7 @@ class TaggerWindow(QtWidgets.QMainWindow):
)
sys.exit()
self.archiveCoverWidget = CoverImageWidget(self.coverImageContainer, CoverImageWidget.ArchiveMode, None, None)
self.archiveCoverWidget = CoverImageWidget(self.coverImageContainer, CoverImageWidget.ArchiveMode, None)
grid_layout = QtWidgets.QGridLayout(self.coverImageContainer)
grid_layout.addWidget(self.archiveCoverWidget)
grid_layout.setContentsMargins(0, 0, 0, 0)
@ -1029,14 +1029,12 @@ class TaggerWindow(QtWidgets.QMainWindow):
issue_count = utils.xlate_int(self.leIssueCount.text())
cover_index_list = self.metadata.get_cover_page_index_list()
selector = SeriesSelectionWindow(
self,
series_name,
issue_number,
year,
issue_count,
cover_index_list,
self.comic_archive,
self.config[0],
self.current_talker(),
@ -2147,7 +2145,7 @@ class TaggerWindow(QtWidgets.QMainWindow):
def check_latest_version_online(self) -> None:
version_checker = VersionChecker()
self.version_check_complete(version_checker.get_latest_version(self.config[0].internal__install_id))
self.version_check_complete(version_checker.get_latest_version())
def version_check_complete(self, new_version: tuple[str, str]) -> None:
if new_version[0] not in (self.version, self.config[0].Dialog_Flags__dont_notify_about_this_version):

View File

@ -202,7 +202,6 @@ def generate_talker_info(talker: ComicTalker, config: settngs.Config[ct_ns], lay
talker_info_layout.parentWidget(),
CoverImageWidget.URLMode,
config.values.Runtime_Options__config.user_cache_dir,
talker,
False,
)
logo.showControls = False

View File

@ -29,15 +29,15 @@ logger = logging.getLogger(__name__)
class VersionChecker:
def get_request_url(self, uuid: str) -> tuple[str, dict[str, str]]:
def get_request_url(self) -> tuple[str, dict[str, str]]:
base_url = "https://api.github.com/repos/comictagger/comictagger/releases/latest"
params: dict[str, str] = {}
return base_url, params
def get_latest_version(self, uuid: str) -> tuple[str, str]:
def get_latest_version(self) -> tuple[str, str]:
try:
url, params = self.get_request_url(uuid)
url, params = self.get_request_url()
release = requests.get(
url,
params=params,