addonStore package

Subpackages

Submodules

addonStore.dataManager module

addonStore.dataManager.initialize()
addonStore.dataManager.terminate()
class addonStore.dataManager._DataManager

Bases: object

_cacheLatestFilename: str = '_cachedLatestAddons.json'
_cacheCompatibleFilename: str = '_cachedCompatibleAddons.json'
_downloadsPendingInstall: Set[Tuple[AddonListItemVM[_AddonStoreModel], PathLike]] = {}
_downloadsPendingCompletion: Set[AddonListItemVM[_AddonStoreModel]] = {}
terminate()
_getLatestAddonsDataForVersion(apiVersion: str) bytes | None
_getCacheHash() str | None
_cacheCompatibleAddons(addonData: str, cacheHash: str | None)
_cacheLatestAddons(addonData: str, cacheHash: str | None)
_getCachedAddonData(cacheFilePath: str) CachedAddonsModel | None
_updateFailureMessage = 'Add-on data update failure'
getLatestCompatibleAddons(onDisplayableError: DisplayableError.OnDisplayableErrorT | None = None) AddonGUICollectionT
getLatestAddons(onDisplayableError: DisplayableError.OnDisplayableErrorT | None = None) AddonGUICollectionT
_deleteCacheInstalledAddon(addonId: str)
_cacheInstalledAddon(addonData: AddonStoreModel)
_getCachedInstalledAddonData(addonId: str) InstalledAddonStoreModel | None
_addonsPendingUpdate() list[_AddonGUIModel]
class addonStore.dataManager._InstalledAddonsCache(*args, **kwargs)

Bases: AutoPropertyObject

cachePropertiesByDefault = True

Specifies whether properties are cached by default; can be overridden for individual properties by setting _cache_propertyName. @type: bool

installedAddons: CaseInsensitiveDict[AddonHandlerModel]
installedAddonGUICollection: AddonGUICollectionT
_get_installedAddons() CaseInsensitiveDict[AddonHandlerModel]

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.

_get_installedAddonGUICollection() AddonGUICollectionT
_abc_impl = <_abc._abc_data object>

addonStore.install module

addonStore.install._getAddonBundleToInstallIfValid(addonPath: str) AddonBundle

@param addonPath: path to the ‘nvda-addon’ file. @return: the addonBundle, if valid @raise DisplayableError if the addon bundle is invalid / incompatible.

addonStore.install._getPreviouslyInstalledAddonById(addon: AddonBundle) AddonHandlerModel | None
addonStore.install.installAddon(addonPath: PathLike) None

Installs the addon at path. Any error messages / warnings are presented to the user via a GUI message box. If attempting to install an addon that is pending removal, it will no longer be pending removal. @note See also L{gui.addonGui.installAddon} @raise DisplayableError on failure

addonStore.network module

addonStore.network._LATEST_API_VER = 'latest'

A string value used in the add-on store to fetch the latest version of all add-ons, i.e include older incompatible versions.

addonStore.network._getCurrentApiVersionForURL() str
addonStore.network._getAddonStoreURL(channel: Channel, lang: str, nvdaApiVersion: str) str
addonStore.network._getCacheHashURL() str
class addonStore.network.AddonFileDownloader

Bases: object

OnCompleteT

alias of Callable[[AddonListItemVM[_AddonStoreModel], Optional[PathLike]], None]

download(addonData: AddonListItemVM[_AddonStoreModel], onComplete: Callable[[AddonListItemVM[_AddonStoreModel], PathLike | None], None], onDisplayableError: DisplayableError.OnDisplayableErrorT)
_done(downloadAddonFuture: Future[PathLike | None])
cancelAll()
_downloadAddonToPath(addonData: AddonListItemVM[_AddonStoreModel], downloadFilePath: str) bool

@return: True if the add-on is downloaded successfully, False if the download is cancelled

_download(listItem: AddonListItemVM[_AddonStoreModel]) PathLike | None
static _checkChecksum(addonFilePath: str, addonData: _AddonStoreModel) bool
static _getCacheFilenameForAddon(addonData: _AddonGUIModel) str