From 5d036e4497a986466bf560591f8be05a976a335d Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Mon, 14 Nov 2022 12:24:33 -0800 Subject: [PATCH 1/2] Fix Python 3.10 type errors --- code/Ribbon.py | 14 +++++++------- code/Views.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/Ribbon.py b/code/Ribbon.py index 73c6669..79c7c84 100644 --- a/code/Ribbon.py +++ b/code/Ribbon.py @@ -52,11 +52,11 @@ def initButtons(self, funcs): def loadButtonConfig(self, buttonName, buttonConfig): - w = self.parent.frameGeometry().height( - )*config["TBAR_ISIZE_REL"]*buttonConfig["iconW"] - h = self.parent.frameGeometry().height( - )*config["TBAR_ISIZE_REL"]*buttonConfig["iconH"] - m = config["TBAR_ISIZE_MARGIN"] + w = int(self.parent.frameGeometry().height( + )*config["TBAR_ISIZE_REL"]*buttonConfig["iconW"]) + h = int(self.parent.frameGeometry().height( + )*config["TBAR_ISIZE_REL"]*buttonConfig["iconH"]) + m = int(config["TBAR_ISIZE_MARGIN"]) icon = QIcon() path = config["TBAR_ICONS"] + buttonConfig["path"] @@ -111,8 +111,8 @@ def __init__(self, parent=None, tracker=None): self.parent = parent self.tracker = tracker - h = self.parent.frameGeometry().height( - ) * config["TBAR_ISIZE_REL"] * config["RBN_HEIGHT"] + h = int(self.parent.frameGeometry().height( + ) * config["TBAR_ISIZE_REL"] * config["RBN_HEIGHT"]) self.setFixedHeight(h) for tabName, tools in config["TBAR_FUNCS"].items(): diff --git a/code/Views.py b/code/Views.py index bef47b1..7b4b7fe 100644 --- a/code/Views.py +++ b/code/Views.py @@ -133,8 +133,8 @@ def __init__(self, parent=None, tracker=None): def viewImage(self, factor=1): # self.verticalScrollBar().setSliderPosition(0) factor = self.currentScale - w = factor*self.viewport().geometry().width() - h = factor*self.viewport().geometry().height() + w = int(factor*self.viewport().geometry().width()) + h = int(factor*self.viewport().geometry().height()) if self._viewImageMode == 0: self.pixmap.setPixmap( self.tracker.pixImage.scaledToWidth(w, Qt.SmoothTransformation)) From f4869a5e16c4a72b98f68930e4ff8678b5529b73 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Mon, 14 Nov 2022 12:24:39 -0800 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d2d7f87..ebbf58a 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Recommended: Approximately 250 MB of free space and 200 MB of memory is needed to run the application using the Tesseract API. If using the Manga OCR model, an additional 450 MB of free space and 800 MB of memory is required. -For developers, the following Python versions are supported: 3.7, 3.8, and 3.9. +For developers, the following Python versions are supported: 3.7, 3.8, 3.9, and 3.10. ## Acknowledgements This project will not be possible without the MangaOcr model by [Maciej Budyƛ](https://github.com/kha-white) and the Tesseract python wrapper by [sirfz](https://github.com/sirfz) and [the tesserocr contributors](https://github.com/sirfz/tesserocr/graphs/contributors).