jdxi_editor.update.checker
Update checker
Asks GitHub Releases whether a newer JD-Xi Editor has been published, with one unauthenticated request (GitHub allows 60 an hour per IP address; the automatic check runs at most once a day). Drafts, pre-releases and releases without a build for this platform are ignored.
Example
>>> checker = UpdateChecker(parent)
>>> checker.update_available.connect(on_update) # (ReleaseInfo, manual)
>>> checker.check(manual=True)
Attributes
Classes
A published release, with the download that suits this install. |
|
Checks GitHub Releases asynchronously; never blocks the UI. |
Functions
|
'v0.9.10' or '0.9.10' -> (0, 9, 10); None if there is no version. |
|
A comparable key that orders pre-releases before their own release. |
|
True if candidate is a later version than current (0.9.10 > 0.9.9). |
|
How this copy was installed, which decides the download offered. |
|
|
|
The newest published release with a build for this kind of install. |
|
|
|
|
|
Automatic checks are on and the last one was over a day ago. |
Module Contents
- jdxi_editor.update.checker.RELEASES_API_URL = 'https://api.github.com/repos/markxbrooks/JDXI-Editor/releases?per_page=10'[source]
- jdxi_editor.update.checker.RELEASES_PAGE_URL = 'https://github.com/markxbrooks/JDXI-Editor/releases'[source]
- class jdxi_editor.update.checker.ReleaseInfo[source]
A published release, with the download that suits this install.
- jdxi_editor.update.checker.parse_version(text: str) tuple[int, ...] | None[source]
‘v0.9.10’ or ‘0.9.10’ -> (0, 9, 10); None if there is no version.
- jdxi_editor.update.checker.version_key(text: str) tuple | None[source]
A comparable key that orders pre-releases before their own release.
1.0.0rc1 < 1.0.0rc2 < 1.0.0, as PEP 440 orders them, so a tester running a candidate is still offered the final build.parse_versioncannot do this: it reads the numbers only, which makes 1.0.0rc1 and 1.0.0 indistinguishable.- Parameters:
text – str a version or tag, e.g. “v1.0.0rc1”
- Returns:
tuple | None (release, is_final, pre rank, pre number), or None
- jdxi_editor.update.checker.is_newer(candidate: str, current: str) bool[source]
True if candidate is a later version than current (0.9.10 > 0.9.9).
- jdxi_editor.update.checker.install_kind() str[source]
How this copy was installed, which decides the download offered.
- jdxi_editor.update.checker.pick_release(releases: Iterable[dict], kind: str) ReleaseInfo | None[source]
The newest published release with a build for this kind of install.
- jdxi_editor.update.checker.settings_bool(settings: PySide6.QtCore.QSettings, key: str, default: bool) bool[source]
- jdxi_editor.update.checker.should_auto_check(settings: PySide6.QtCore.QSettings | None = None, now: datetime.datetime | None = None) bool[source]
Automatic checks are on and the last one was over a day ago.
- class jdxi_editor.update.checker.UpdateChecker(parent: PySide6.QtCore.QObject | None = None, url: str = RELEASES_API_URL, current_version: str = __version__, kind: str | None = None, settings: PySide6.QtCore.QSettings | None = None, now: Callable[[], datetime.datetime] = lambda : ...)[source]
Bases:
PySide6.QtCore.QObjectChecks GitHub Releases asynchronously; never blocks the UI.