adsfolio.gui.updates
Check GitHub for stable desktop releases without blocking the window.
- class adsfolio.gui.updates.InstallationKind(*values)[source]
Bases:
enum.EnumHow this copy of ADSfolio was installed, which decides how to update.
- DESKTOP = 'Desktop application'
- HOMEBREW = 'Homebrew application'
- PYTHON = 'Python installation'
- SOURCE = 'Local source launcher'
- class adsfolio.gui.updates.Release(version, url, tag='', assets=())[source]
Bases:
objectA stable release, its download page, and its published asset names.
- Parameters:
version (packaging.version.Version)
url (str)
tag (str)
- version: packaging.version.Version
- class adsfolio.gui.updates.UpdateChecker(parent=None)[source]
Bases:
PySide6.QtCore.QObjectKeep one asynchronous release check and its latest result.
- Parameters:
parent (QObject | None)
- changed
- checked_at: datetime.datetime | None
- fetch_changelog()[source]
Load the notes between this version and the available release.
The notes come from
CHANGELOG.mdat the release tag, because the GitHub release body contains only generated comparison links.- Return type:
None
- finished
- latest: adsfolio.gui.updates.Release | None
- staticMetaObject = PySide6.QtCore.QMetaObject("UpdateChecker" inherits "QObject": Methods: #4 type=Signal, signature=changed() #5 type=Signal, signature=finished() #6 type=Slot, signature=check() #7 type=Slot, signature=_complete_changelog() #8 type=Slot, signature=_complete() )
- class adsfolio.gui.updates.UpdateDownloader(parent=None)[source]
Bases:
PySide6.QtCore.QObjectDownload one release asset and verify it against the release checksums.
The checksum file is fetched first. The asset streams to
<name>.partwhile it is hashed, and it is renamed only after the SHA-256 digest matches. The checksums come from the same release, so the check detects corrupted or truncated downloads; it does not authenticate the publisher.- Parameters:
parent (QObject | None)
- changed
- completed
- path: pathlib.Path | None
- progress
- property release: adsfolio.gui.updates.Release | None[source]
Return the release of the current or last download.
- start(release, name, directory)[source]
Download asset name of release into directory.
- Parameters:
release (adsfolio.gui.updates.Release)
name (str)
directory (pathlib.Path)
- Return type:
None
- staticMetaObject = PySide6.QtCore.QMetaObject("UpdateDownloader" inherits "QObject": Methods: #4 type=Signal, signature=changed() #5 type=Signal, signature=progress(PyObject,PyObject), parameters=PyObject, PyObject #6 type=Signal, signature=completed(PyObject), parameters=PyObject #7 type=Slot, signature=_checksums_done() #8 type=Slot, signature=_forward_progress(qlonglong,qlonglong), parameters=qlonglong, qlonglong #9 type=Slot, signature=_write_available() #10 type=Slot, signature=_asset_done() )
- adsfolio.gui.updates.asset_name(platform, machine)[source]
Return the release asset that installs on a platform, or None.
- Parameters:
platform (str) – A sys.platform value.
machine (str) – A
platform.machine()value of the running process.
- Return type:
str | None
- adsfolio.gui.updates.changelog_between(markdown, current, latest)[source]
Return changelog sections newer than current up to latest.
Sections start at
## <version>headings. Sections whose heading does not begin with a version, such as## Unreleased, are skipped.- Parameters:
markdown (str)
current (packaging.version.Version)
latest (packaging.version.Version)
- Return type:
- adsfolio.gui.updates.download_filename(release, name)[source]
Insert the release version into an unversioned asset file name.
- Parameters:
release (adsfolio.gui.updates.Release)
name (str)
- Return type:
- adsfolio.gui.updates.installation_kind(environ=None, *, frozen=None, platform=None, caskrooms=None)[source]
Classify the running installation.
The source launcher is checked first: a machine can have both a Homebrew cask record and a source launcher that replaced the cask’s application.
- Parameters:
environ (collections.abc.Mapping[str, str] | None)
frozen (bool | None)
platform (str | None)
caskrooms (tuple[pathlib.Path, ...] | None)
- Return type:
- adsfolio.gui.updates.parse_release(payload)[source]
Read a stable release from a GitHub API response.
- Raises:
TypeError – If the response is not a JSON object.
ValueError – If the response does not describe a published stable version.
- Parameters:
payload (object)
- Return type: