diff --git a/__init__.py b/__init__.py index b0a6964..c8ec94f 100644 --- a/__init__.py +++ b/__init__.py @@ -14,7 +14,7 @@ class WordDumbDumb(InterfaceActionBase): supported_platforms = ["linux", "osx", "windows"] author = "xxyzz" version = VERSION - minimum_calibre_version = (6, 27, 0) + minimum_calibre_version = (7, 1, 0) actual_plugin = "calibre_plugins.worddumb.ui:WordDumb" def is_customizable(self): diff --git a/docs/installation.rst b/docs/installation.rst index ec03f44..73edfa7 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -1,7 +1,7 @@ Installation ============ -Install calibre 6.9.0+ +Install calibre 7.1.0+ ---------------------- - Arch Linux: @@ -35,7 +35,7 @@ Use `Chocolatey `_ or download from https://calibre-eboo # choco install calibre -Install Python 3.10+ and pip +Install Python 3.11+ and pip ---------------------------- - Arch Linux: diff --git a/error_dialogs.py b/error_dialogs.py index 64ef026..594b08c 100644 --- a/error_dialogs.py +++ b/error_dialogs.py @@ -3,7 +3,7 @@ GITHUB_URL = "https://github.com/xxyzz/WordDumb" INSTALL_PYTHON_DOC = ( - "https://xxyzz.github.io/WordDumb/installation.html#install-python-3-10-and-pip" + "https://xxyzz.github.io/WordDumb/installation.html#install-python-3-11-and-pip" ) load_translations() # type: ignore diff --git a/interval.py b/interval.py index 1519491..548f30c 100644 --- a/interval.py +++ b/interval.py @@ -41,7 +41,7 @@ def insert(self, node: Node | None, interval: Interval) -> Node: return node - def insert_intervals(self, intervals: Interval) -> None: + def insert_intervals(self, intervals: list[Interval]) -> None: for interval in intervals: self.insert(self.root, interval) diff --git a/mediawiki.py b/mediawiki.py index 31eae4c..7084bef 100644 --- a/mediawiki.py +++ b/mediawiki.py @@ -2,7 +2,7 @@ import sqlite3 from collections import defaultdict -from datetime import datetime +from datetime import datetime, timezone from functools import partial from pathlib import Path from typing import TypedDict @@ -483,16 +483,13 @@ def query(self, items: list[str]) -> None: def inception_text(inception_str: str) -> str: - # don't need to remove the last "Z" in Python 3.11 - inception_str = inception_str.removesuffix("Z") if inception_str.startswith("-"): bc = int(inception_str[1:5]) + 1 # 2BC: -0001, 1BC: +0000, 1AD: 0001 years = datetime.now().year + bc return f"Inception: {bc} BC({years} years ago)" else: inception = datetime.fromisoformat(inception_str) - # Python 3.11: datetime.now(timezone.utc) - inception - years = (datetime.now() - inception).days // 365 + years = (datetime.now(timezone.utc) - inception).days // 365 return ( f"Inception: {inception.strftime('%d %B %Y').lstrip('0')}" f"({years} years ago)"