Skip to content

Commit

Permalink
Set minimum calibre version to 7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyzz committed Dec 4, 2023
1 parent d0cf598 commit 9535aea
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installation
============

Install calibre 6.9.0+
Install calibre 7.1.0+
----------------------

- Arch Linux:
Expand Down Expand Up @@ -35,7 +35,7 @@ Use `Chocolatey <https://chocolatey.org>`_ or download from https://calibre-eboo
# choco install calibre
Install Python 3.10+ and pip
Install Python 3.11+ and pip
----------------------------

- Arch Linux:
Expand Down
2 changes: 1 addition & 1 deletion error_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 2 additions & 5 deletions mediawiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)"
Expand Down

0 comments on commit 9535aea

Please sign in to comment.