Skip to content

Commit 4b026be

Browse files
committed
chore: update deps, fix linter errors
1 parent 7c54789 commit 4b026be

File tree

4 files changed

+573
-529
lines changed

4 files changed

+573
-529
lines changed

normcap/gui/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def _exit_application(self, delay: Seconds = 0) -> None:
501501
logger.debug("Debug images in %s%snormcap", utils.tempfile.gettempdir(), os.sep)
502502

503503
# Not sure why, but quit doesn't work reliably if called directly
504-
QtCore.QTimer.singleShot(0, lambda: self.quit())
504+
QtCore.QTimer.singleShot(0, self.quit)
505505

506506
# Use harsher fallback if quit() didn't work
507507
QtCore.QTimer.singleShot(500, lambda: sys.exit(1))

normcap/gui/language_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _on_download_error(self, reason: str, url: str) -> None:
121121
@QtCore.Slot(bytes, str)
122122
def _on_download_finished(self, data: bytes, url: str) -> None:
123123
"""Save language to tessdata folder."""
124-
file_name = url.split("/")[-1]
124+
file_name = url.rsplit("/", maxsplit=1)[-1]
125125
with Path(self.tessdata_path / file_name).open(mode="wb") as fh:
126126
fh.write(data)
127127
self._update_models()

normcap/gui/update_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _is_new_version(current: str, other: str) -> bool:
139139
logging.debug("Discarding pre-release version %s", other)
140140
return False
141141

142-
current = current.split("-")[0]
142+
current = current.split("-", maxsplit=1)[0]
143143
current_version = [int(c) for c in current.split(".")]
144144
other_version = [int(c) for c in other.split(".")]
145145
return other_version > current_version

0 commit comments

Comments
 (0)