addonStore.models package

Submodules

addonStore.models.addon module

class addonStore.models.addon._AddonGUIModel(*args, **kwargs)

Bases: SupportsAddonState, SupportsVersionCheck, Protocol

Needed to display information in add-on store. May come from manifest or add-on store data.

addonId: str
displayName: str
description: str
addonVersionName: str
channel: Channel
homepage: str | None
minNVDAVersion: MajorMinorPatch
lastTestedVersion: MajorMinorPatch
legacy: bool

Legacy add-ons contain invalid metadata and should not be accessible through the add-on store.

property minimumNVDAVersion: Tuple[int, int, int]

In order to support SupportsVersionCheck

property lastTestedNVDAVersion: Tuple[int, int, int]

In order to support SupportsVersionCheck

property _addonHandlerModel: AddonHandlerModel | None

Returns the Addon model tracked in addonHandler, if it exists.

property name: str

In order to support SupportsVersionCheck

property listItemVMId: str
asdict() Dict[str, Any]
_abc_impl = <_abc._abc_data object>
_is_protocol = True
class addonStore.models.addon._AddonStoreModel(*args, **kwargs)

Bases: _AddonGUIModel

addonId: str
displayName: str
description: str
addonVersionName: str
channel: Channel
homepage: str | None
minNVDAVersion: MajorMinorPatch
lastTestedVersion: MajorMinorPatch
legacy: bool

Legacy add-ons contain invalid metadata and should not be accessible through the add-on store.

publisher: str
license: str
licenseURL: str | None
sourceURL: str
URL: str
sha256: str
addonVersionNumber: MajorMinorPatch
reviewURL: str | None
property tempDownloadPath: str

Path where this add-on should be downloaded to. After download completion, the add-on is moved to cachedDownloadPath.

property cachedDownloadPath: str

Path where this add-on file should be cached, after a successful download. A file at this path may or may not be currently installed to the NVDA system.

property isPendingInstall: bool

True if this addon has not yet been fully installed.

_abc_impl = <_abc._abc_data object>
_is_protocol = False
class addonStore.models.addon._AddonManifestModel(*args, **kwargs)

Bases: _AddonGUIModel

Get data from an add-on’s manifest. Can be from an add-on bundle or installed add-on.

addonId: str
addonVersionName: str
channel: Channel
homepage: str | None
minNVDAVersion: MajorMinorPatch
lastTestedVersion: MajorMinorPatch
manifest: AddonManifest
legacy: bool = False

Legacy add-ons contain invalid metadata and should not be accessible through the add-on store.

property displayName: str
property description: str
property author: str
_abc_impl = <_abc._abc_data object>
_is_protocol = False
class addonStore.models.addon.AddonManifestModel(addonId: str, addonVersionName: str, channel: Channel, homepage: str | None, minNVDAVersion: MajorMinorPatch, lastTestedVersion: MajorMinorPatch, manifest: AddonManifest, legacy: bool = False)

Bases: _AddonManifestModel

Get data from an add-on’s manifest. Can be from an add-on bundle or installed add-on.

addonId: str
addonVersionName: str
channel: Channel
homepage: str | None
minNVDAVersion: MajorMinorPatch
lastTestedVersion: MajorMinorPatch
manifest: AddonManifest
legacy: bool = False

Legacy add-ons contain invalid metadata and should not be accessible through the add-on store.

_abc_impl = <_abc._abc_data object>
_is_protocol = False
class addonStore.models.addon.InstalledAddonStoreModel(addonId: str, publisher: str, addonVersionName: str, channel: Channel, homepage: str | None, license: str, licenseURL: str | None, sourceURL: str, URL: str, sha256: str, addonVersionNumber: MajorMinorPatch, minNVDAVersion: MajorMinorPatch, lastTestedVersion: MajorMinorPatch, reviewURL: str | None, legacy: bool = False)

Bases: _AddonManifestModel, _AddonStoreModel

Data from an add-on installed from the add-on store.

addonId: str
publisher: str
addonVersionName: str
channel: Channel
homepage: str | None
license: str
licenseURL: str | None
sourceURL: str
URL: str
sha256: str
addonVersionNumber: MajorMinorPatch
minNVDAVersion: MajorMinorPatch
lastTestedVersion: MajorMinorPatch
reviewURL: str | None
legacy: bool = False

Legacy add-ons contain invalid metadata and should not be accessible through the add-on store.

property manifest: AddonManifest
_abc_impl = <_abc._abc_data object>
_is_protocol = False
class addonStore.models.addon.AddonStoreModel(addonId: str, displayName: str, description: str, publisher: str, addonVersionName: str, channel: Channel, homepage: str | None, license: str, licenseURL: str | None, sourceURL: str, URL: str, sha256: str, addonVersionNumber: MajorMinorPatch, minNVDAVersion: MajorMinorPatch, lastTestedVersion: MajorMinorPatch, reviewURL: str | None, legacy: bool = False)

Bases: _AddonStoreModel

Data from an add-on from the add-on store.

addonId: str
displayName: str
description: str
publisher: str
addonVersionName: str
channel: Channel
homepage: str | None
license: str
licenseURL: str | None
sourceURL: str
URL: str
sha256: str
addonVersionNumber: MajorMinorPatch
minNVDAVersion: MajorMinorPatch
lastTestedVersion: MajorMinorPatch
reviewURL: str | None
legacy: bool = False

Legacy add-ons contain invalid metadata and should not be accessible through the add-on store.

_abc_impl = <_abc._abc_data object>
_is_protocol = False
class addonStore.models.addon.CachedAddonsModel(cachedAddonData: 'AddonGUICollectionT', cacheHash: str | None, cachedLanguage: str, nvdaAPIVersion: Tuple[int, int, int] | str)

Bases: object

cachedAddonData: AddonGUICollectionT
cacheHash: str | None
cachedLanguage: str
nvdaAPIVersion: Tuple[int, int, int] | str
addonStore.models.addon._createInstalledStoreModelFromData(addon: Dict[str, Any]) InstalledAddonStoreModel
addonStore.models.addon._createStoreModelFromData(addon: Dict[str, Any]) AddonStoreModel
addonStore.models.addon._createGUIModelFromManifest(addon: AddonHandlerBaseModel) AddonManifestModel
addonStore.models.addon._createAddonGUICollection() AddonGUICollectionT

Add-ons that have the same ID except differ in casing cause a path collision, as add-on IDs are installed to a case insensitive path. Therefore addon IDs should be treated as case insensitive.

addonStore.models.addon._createStoreCollectionFromJson(jsonData: str) AddonGUICollectionT

Use json string to construct a listing of available addons. See https://github.com/nvaccess/addon-datastore#api-data-generation-details for details of the data.

addonStore.models.channel module

class addonStore.models.channel.Channel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: DisplayStringStrEnum

ALL = 'all'
STABLE = 'stable'
BETA = 'beta'
DEV = 'dev'
EXTERNAL = 'external'
property _displayStringLabels: Dict[Channel, str]

Specify a dictionary which takes members of the Enum and returns the translated display string.

addonStore.models.channel._channelFilters: OrderedDict[Channel, Set[Channel]] = {Channel.ALL: {Channel.BETA, Channel.DEV, Channel.EXTERNAL, Channel.STABLE}, Channel.BETA: {Channel.BETA}, Channel.DEV: {Channel.DEV}, Channel.EXTERNAL: {Channel.EXTERNAL}, Channel.STABLE: {Channel.STABLE}}

A dictionary where the keys are channel groups to filter by, and the values are which channels should be shown for a given filter.

addonStore.models.status module

class addonStore.models.status.EnabledStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: DisplayStringEnum

ALL = 1
ENABLED = 2
DISABLED = 3
property _displayStringLabels: Dict[EnabledStatus, str]

Specify a dictionary which takes members of the Enum and returns the translated display string.

class addonStore.models.status.AvailableAddonStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: DisplayStringEnum

Values to represent the status of add-ons within the NVDA add-on store. Although related, these are independent of the states in L{addonHandler}

UNKNOWN = 1
PENDING_REMOVE = 2
AVAILABLE = 3
UPDATE = 4
UPDATE_INCOMPATIBLE = 5
REPLACE_SIDE_LOAD = 6

Used when an addon in the store matches an installed add-on ID. However, it cannot be determined if it is an upgrade. Encourage the user to compare the version strings.

INCOMPATIBLE = 7
DOWNLOADING = 8
DOWNLOAD_FAILED = 9
DOWNLOAD_SUCCESS = 10
INSTALLING = 11
INSTALL_FAILED = 12
INSTALLED = 13
PENDING_INCOMPATIBLE_DISABLED = 14
INCOMPATIBLE_DISABLED = 15
PENDING_DISABLE = 16
DISABLED = 17
PENDING_INCOMPATIBLE_ENABLED = 18
INCOMPATIBLE_ENABLED = 19
PENDING_ENABLE = 20
ENABLED = 21
RUNNING = 22
property _displayStringLabels: Dict[AvailableAddonStatus, str]

Specify a dictionary which takes members of the Enum and returns the translated display string.

class addonStore.models.status.AddonStateCategory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, Enum

For backwards compatibility, the enums must remain functionally a string. I.E. the following must be true: > assert isinstance(AddonStateCategory.PENDING_REMOVE, str) > assert AddonStateCategory.PENDING_REMOVE == “pendingRemovesSet”

PENDING_REMOVE = 'pendingRemovesSet'
PENDING_INSTALL = 'pendingInstallsSet'
DISABLED = 'disabledAddons'
PENDING_ENABLE = 'pendingEnableSet'
PENDING_DISABLE = 'pendingDisableSet'
OVERRIDE_COMPATIBILITY = 'overrideCompatibility'

Should be reset when changing to a new breaking release, add-ons should be removed from this list when they are updated, disabled or removed

BLOCKED = 'blocked'

Add-ons that are blocked from running because they are incompatible

PENDING_OVERRIDE_COMPATIBILITY = 'PENDING_OVERRIDE_COMPATIBILITY'

Add-ons in this state are incompatible but their compatibility would be overridden on the next restart.

_generate_next_value_(start, count, last_values)

Generate the next value when not given.

name: the name of the member start: the initial start value or None count: the number of existing members last_values: the list of values assigned

_new_member_(**kwargs)

Create and return a new object. See help(type) for accurate signature.

_use_args_ = True
_member_names_ = ['PENDING_REMOVE', 'PENDING_INSTALL', 'DISABLED', 'PENDING_ENABLE', 'PENDING_DISABLE', 'OVERRIDE_COMPATIBILITY', 'BLOCKED', 'PENDING_OVERRIDE_COMPATIBILITY']
_member_map_ = {'BLOCKED': AddonStateCategory.BLOCKED, 'DISABLED': AddonStateCategory.DISABLED, 'OVERRIDE_COMPATIBILITY': AddonStateCategory.OVERRIDE_COMPATIBILITY, 'PENDING_DISABLE': AddonStateCategory.PENDING_DISABLE, 'PENDING_ENABLE': AddonStateCategory.PENDING_ENABLE, 'PENDING_INSTALL': AddonStateCategory.PENDING_INSTALL, 'PENDING_OVERRIDE_COMPATIBILITY': AddonStateCategory.PENDING_OVERRIDE_COMPATIBILITY, 'PENDING_REMOVE': AddonStateCategory.PENDING_REMOVE}
_value2member_map_ = {'PENDING_OVERRIDE_COMPATIBILITY': AddonStateCategory.PENDING_OVERRIDE_COMPATIBILITY, 'blocked': AddonStateCategory.BLOCKED, 'disabledAddons': AddonStateCategory.DISABLED, 'overrideCompatibility': AddonStateCategory.OVERRIDE_COMPATIBILITY, 'pendingDisableSet': AddonStateCategory.PENDING_DISABLE, 'pendingEnableSet': AddonStateCategory.PENDING_ENABLE, 'pendingInstallsSet': AddonStateCategory.PENDING_INSTALL, 'pendingRemovesSet': AddonStateCategory.PENDING_REMOVE}
_unhashable_values_ = []
_member_type_

alias of str

_value_repr_()

Return repr(self).

class addonStore.models.status._StatusFilterKey(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: DisplayStringEnum

Keys for filtering by status in the NVDA add-on store.

INSTALLED = 1
UPDATE = 2
AVAILABLE = 3
INCOMPATIBLE = 4
property _displayStringLabels: Dict[_StatusFilterKey, str]

Specify a dictionary which takes members of the Enum and returns the translated display string.

property _displayStringLabelsWithAccelerators: Dict[_StatusFilterKey, str]
property displayStringWithAccelerator: str

@return: The translated UI display string with accelerator that should be used for this value of the enum.

addonStore.models.status._getDownloadableStatus(model: _AddonGUIModel) AvailableAddonStatus | None
addonStore.models.status._getUpdateStatus(model: _AddonGUIModel) AvailableAddonStatus | None
addonStore.models.status._getInstalledStatus(model: _AddonGUIModel) AvailableAddonStatus | None
addonStore.models.status.getStatus(model: _AddonGUIModel, context: _StatusFilterKey) AvailableAddonStatus

Get status for an add-on in the context of the current tab in the add-on store. e.g. “update available” from the update tab, and “installed (incompatible)” from the installed tab.

Parameters:
  • model – Add-on to determine the status of.

  • context – Add-on Store tab context we are checking the status for.

Returns:

Status of add-on for the context of the current tab.

addonStore.models.status._statusFilters: OrderedDict[_StatusFilterKey, Set[AvailableAddonStatus]] = {_StatusFilterKey.AVAILABLE: {AvailableAddonStatus.AVAILABLE, AvailableAddonStatus.DISABLED, AvailableAddonStatus.DOWNLOADING, AvailableAddonStatus.DOWNLOAD_FAILED, AvailableAddonStatus.DOWNLOAD_SUCCESS, AvailableAddonStatus.ENABLED, AvailableAddonStatus.INCOMPATIBLE, AvailableAddonStatus.INCOMPATIBLE_DISABLED, AvailableAddonStatus.INCOMPATIBLE_ENABLED, AvailableAddonStatus.INSTALLED, AvailableAddonStatus.INSTALLING, AvailableAddonStatus.INSTALL_FAILED, AvailableAddonStatus.PENDING_DISABLE, AvailableAddonStatus.PENDING_ENABLE, AvailableAddonStatus.PENDING_INCOMPATIBLE_DISABLED, AvailableAddonStatus.PENDING_INCOMPATIBLE_ENABLED, AvailableAddonStatus.PENDING_REMOVE, AvailableAddonStatus.REPLACE_SIDE_LOAD, AvailableAddonStatus.RUNNING, AvailableAddonStatus.UPDATE, AvailableAddonStatus.UPDATE_INCOMPATIBLE}, _StatusFilterKey.INCOMPATIBLE: {AvailableAddonStatus.INCOMPATIBLE_DISABLED, AvailableAddonStatus.INCOMPATIBLE_ENABLED, AvailableAddonStatus.PENDING_INCOMPATIBLE_DISABLED, AvailableAddonStatus.PENDING_INCOMPATIBLE_ENABLED, AvailableAddonStatus.UNKNOWN}, _StatusFilterKey.INSTALLED: {AvailableAddonStatus.DISABLED, AvailableAddonStatus.DOWNLOAD_SUCCESS, AvailableAddonStatus.ENABLED, AvailableAddonStatus.INCOMPATIBLE_DISABLED, AvailableAddonStatus.INCOMPATIBLE_ENABLED, AvailableAddonStatus.INSTALLED, AvailableAddonStatus.PENDING_DISABLE, AvailableAddonStatus.PENDING_ENABLE, AvailableAddonStatus.PENDING_INCOMPATIBLE_DISABLED, AvailableAddonStatus.PENDING_INCOMPATIBLE_ENABLED, AvailableAddonStatus.PENDING_REMOVE, AvailableAddonStatus.RUNNING}, _StatusFilterKey.UPDATE: {AvailableAddonStatus.DOWNLOADING, AvailableAddonStatus.DOWNLOAD_FAILED, AvailableAddonStatus.DOWNLOAD_SUCCESS, AvailableAddonStatus.INSTALLED, AvailableAddonStatus.INSTALLING, AvailableAddonStatus.INSTALL_FAILED, AvailableAddonStatus.REPLACE_SIDE_LOAD, AvailableAddonStatus.UPDATE, AvailableAddonStatus.UPDATE_INCOMPATIBLE}}

A dictionary where the keys are a status to filter by, and the values are which statuses should be shown for a given filter.

class addonStore.models.status.SupportsAddonState(*args, **kwargs)

Bases: SupportsVersionCheck, Protocol

property _stateHandler: AddonsState
property isEnabled: bool
property isRunning: bool
property pendingInstallPath: str
property installPath: str
property isPendingInstall: bool

True if this addon has not yet been fully installed.

property isPendingRemove: bool

True if this addon is marked for removal.

property isDisabled: bool
property isBlocked: bool
_abc_impl = <_abc._abc_data object>
_is_protocol = True
property isPendingEnable: bool
minimumNVDAVersion: Tuple[int, int, int]
lastTestedNVDAVersion: Tuple[int, int, int]
name: str
property isPendingDisable: bool
property _anyPendingInstallForId: bool
property requiresRestart: bool
property isInstalled: bool

addonStore.models.version module

class addonStore.models.version.MajorMinorPatch(major, minor, patch)

Bases: NamedTuple

Create new instance of MajorMinorPatch(major, minor, patch)

major: int

Alias for field number 0

minor: int

Alias for field number 1

patch: int

Alias for field number 2

classmethod _parseVersionFromVersionStr(version: str) MajorMinorPatch
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {'patch': 0}
_fields = ('major', 'minor', 'patch')
classmethod _make(iterable)

Make a new MajorMinorPatch object from a sequence or iterable

_replace(**kwds)

Return a new MajorMinorPatch object replacing specified fields with new values

class addonStore.models.version.SupportsVersionCheck(*args, **kwargs)

Bases: Protocol

Examples implementing this protocol include: - addonHandler.Addon - addonHandler.AddonBundle - addonStore.models._AddonGUIModel - addonStore.models._AddonStoreModel - addonStore.models.AddonManifestModel - addonStore.models.AddonStoreModel - addonStore.models.InstalledAddonStoreModel

minimumNVDAVersion: Tuple[int, int, int]
lastTestedNVDAVersion: Tuple[int, int, int]
name: str
property _hasOverriddenCompat: bool

If True, this add-on has been manually overriden. The affects of override may be pending restart

property overrideIncompatibility: bool

If True, NVDA should enable this add-on where it would normally be blocked due to incompatibility.

enableCompatibilityOverride()

Should be reset when changing to a new breaking release, and when this add-on is updated, disabled or removed.

property canOverrideCompatibility: bool
property _isTested: bool
property _hasGotRequiredSupport: bool
property isCompatible: bool
getIncompatibleReason(backwardsCompatToVersion: Tuple[int, int, int] = (2024, 1, 0), currentAPIVersion: Tuple[int, int, int] = (2024, 4, 0)) str | None
_abc_impl = <_abc._abc_data object>
_is_protocol = True
addonStore.models.version.getAddonCompatibilityMessage() str
addonStore.models.version.getAddonCompatibilityConfirmationMessage() str