gui.addonStoreGui.viewModels package
Submodules
gui.addonStoreGui.viewModels.action module
- class gui.addonStoreGui.viewModels.action._AddonAction(displayName: str, actionHandler: Callable[[ActionTargetT], None], validCheck: Callable[[ActionTargetT], bool], actionTarget: ActionTargetT)
Bases:
Generic
[ActionTargetT
],ABC
@param displayName: Translated string, to be displayed to the user. Should describe the action / behaviour. @param actionHandler: Call when the action is triggered. @param validCheck: Is the action valid for the current target @param actionTarget: The target this action will be applied to. L{updated} notifies of modification.
- updated
Notify of changes to the action
- abstract _listItemChanged(addonListItemVM: AddonListItemVM)
- property isValid: bool
- property actionTarget: ActionTargetT
- _notify()
- _abc_impl = <_abc._abc_data object>
- class gui.addonStoreGui.viewModels.action.AddonActionVM(displayName: str, actionHandler: Callable[[AddonListItemVM], None], validCheck: Callable[[AddonListItemVM], bool], actionTarget: AddonListItemVM | None)
Bases:
_AddonAction
[Optional
[AddonListItemVM
]]Actions/behaviour that can be embedded within other views/viewModels that can apply to a single L{AddonListItemVM}. Use the L{AddonActionVM.updated} extensionPoint.Action to be notified about changes. E.G.: - Updates within the AddonListItemVM (perhaps changing the action validity) - Entirely changing the AddonListItemVM action will be applied to, the validity can be checked for the new item.
@param displayName: Translated string, to be displayed to the user. Should describe the action / behaviour. @param actionHandler: Call when the action is triggered. @param validCheck: Is the action valid for the current listItemVM @param actionTarget: The listItemVM this action will be applied to. L{updated} notifies of modification.
- _listItemChanged(addonListItemVM: AddonListItemVM | None)
Something inside the AddonListItemVM has changed
- property actionTarget: ActionTargetT
- _abc_impl = <_abc._abc_data object>
- class gui.addonStoreGui.viewModels.action.BatchAddonActionVM(displayName: str, actionHandler: Callable[[Iterable[AddonListItemVM]], None], validCheck: Callable[[Iterable[AddonListItemVM]], bool], actionTarget: Iterable[AddonListItemVM])
Bases:
_AddonAction
[Iterable
[AddonListItemVM
]]Actions/behaviour that can be embedded within other views/viewModels that can apply to a group of L{AddonListItemVM}. Use the L{BatchAddonActionVM.updated} extensionPoint.Action to be notified about changes. E.G.: - Updates within the AddonListItemVM (perhaps changing the action validity) - Entirely changing the AddonListItemVM action will be applied to, the validity can be checked for the new item.
@param displayName: Translated string, to be displayed to the user. Should describe the action / behaviour. @param actionHandler: Call when the action is triggered. @param validCheck: Is the action valid for the current listItemVMs @param actionTarget: The listItemVMs this action will be applied to. L{updated} notifies of modification.
- _listItemChanged(addonListItemVM: AddonListItemVM)
Something inside the AddonListItemVM has changed
- _abc_impl = <_abc._abc_data object>
- property actionTarget: ActionTargetT
gui.addonStoreGui.viewModels.addonList module
- class gui.addonStoreGui.viewModels.addonList._AddonListFieldData(displayString: str, width: int, hideStatuses: FrozenSet[addonStore.models.status._StatusFilterKey] = frozenset())
Bases:
object
- displayString: str
- width: int
- hideStatuses: FrozenSet[_StatusFilterKey] = frozenset({})
Hide this field if the current tab filter is in hideStatuses.
- class gui.addonStoreGui.viewModels.addonList.AddonListField(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
_AddonListFieldData
,Enum
An ordered enum of fields to use as columns in the add-on list.
- displayName = _AddonListFieldData(displayString='Name', width=150, hideStatuses=frozenset())
- status = _AddonListFieldData(displayString='Status', width=150, hideStatuses=frozenset())
- currentAddonVersionName = _AddonListFieldData(displayString='Installed version', width=100, hideStatuses=frozenset({<_StatusFilterKey.AVAILABLE: 3>}))
- availableAddonVersionName = _AddonListFieldData(displayString='Available version', width=100, hideStatuses=frozenset({<_StatusFilterKey.INSTALLED: 1>, <_StatusFilterKey.INCOMPATIBLE: 4>}))
- channel = _AddonListFieldData(displayString='Channel', width=50, hideStatuses=frozenset())
- publisher = _AddonListFieldData(displayString='Publisher', width=100, hideStatuses=frozenset({<_StatusFilterKey.INSTALLED: 1>, <_StatusFilterKey.INCOMPATIBLE: 4>}))
- author = _AddonListFieldData(displayString='Author', width=100, hideStatuses=frozenset({<_StatusFilterKey.UPDATE: 2>, <_StatusFilterKey.AVAILABLE: 3>}))
- _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_ = False
- _member_names_ = ['displayName', 'status', 'currentAddonVersionName', 'availableAddonVersionName', 'channel', 'publisher', 'author']
- _member_map_ = {'author': AddonListField.author, 'availableAddonVersionName': AddonListField.availableAddonVersionName, 'channel': AddonListField.channel, 'currentAddonVersionName': AddonListField.currentAddonVersionName, 'displayName': AddonListField.displayName, 'publisher': AddonListField.publisher, 'status': AddonListField.status}
- _value2member_map_ = {}
- _unhashable_values_ = [_AddonListFieldData(displayString='Name', width=150, hideStatuses=frozenset()), _AddonListFieldData(displayString='Status', width=150, hideStatuses=frozenset()), _AddonListFieldData(displayString='Installed version', width=100, hideStatuses=frozenset({<_StatusFilterKey.AVAILABLE: 3>})), _AddonListFieldData(displayString='Available version', width=100, hideStatuses=frozenset({<_StatusFilterKey.INSTALLED: 1>, <_StatusFilterKey.INCOMPATIBLE: 4>})), _AddonListFieldData(displayString='Channel', width=50, hideStatuses=frozenset()), _AddonListFieldData(displayString='Publisher', width=100, hideStatuses=frozenset({<_StatusFilterKey.INSTALLED: 1>, <_StatusFilterKey.INCOMPATIBLE: 4>})), _AddonListFieldData(displayString='Author', width=100, hideStatuses=frozenset({<_StatusFilterKey.UPDATE: 2>, <_StatusFilterKey.AVAILABLE: 3>}))]
- _member_type_
alias of
_AddonListFieldData
- _value_repr_()
Return repr(self).
- displayString: str
- width: int
- class gui.addonStoreGui.viewModels.addonList.AddonListItemVM(model: _AddonModelT, status: AvailableAddonStatus = AvailableAddonStatus.AVAILABLE)
Bases:
Generic
[_AddonModelT
]- property model: _AddonModelT
- property status: AvailableAddonStatus
- property Id: str
- canUseInstallAction() bool
- canUseInstallOverrideIncompatibilityAction() bool
- canUseUpdateAction() bool
- canUseUpdateOverrideIncompatibilityAction() bool
- canUseReplaceAction() bool
- canUseRemoveAction() bool
- canUseEnableAction() bool
- canUseEnableOverrideIncompatibilityAction() bool
- canUseDisableAction() bool
- class gui.addonStoreGui.viewModels.addonList.AddonDetailsVM(listVM: AddonListVM)
Bases:
object
- property listItem: AddonListItemVM | None
- class gui.addonStoreGui.viewModels.addonList.AddonListVM(addons: List[AddonListItemVM], storeVM: AddonStoreVM)
Bases:
object
- property presentedFields: List[AddonListField]
- _itemDataUpdated(addonListItemVM: AddonListItemVM)
- resetListItems(listVMs: List[AddonListItemVM])
- getAddonFieldText(index: int, field: AddonListField) str | None
Get the text for an item’s attribute. @param index: The index of the item in _addonsFilteredOrdered @param field: The field attribute for the addon. See L{AddonList.presentedFields} @return: The text for the addon attribute
- _getAddonFieldText(listItemVM: AddonListItemVM, field: AddonListField) str
- getCount() int
- getSelectedIndex() int | None
- getAddonAtIndex(index: int) AddonListItemVM
- setSelection(index: int | None) AddonListItemVM | None
- getSelection() AddonListItemVM | None
- _validate(sortField: AddonListField | None = None, selectionIndex: int | None = None, selectionId: str | None = None)
- setSortField(modelField: AddonListField)
- _getFilteredSortedIds() List[str]
- _tryPersistSelection(newOrder: List[str]) str | None
Get the ID of the selection in new order, _addonsFilteredOrdered should not have changed yet.
- _updateAddonListing()
- applyFilter(filterText: str) None
gui.addonStoreGui.viewModels.store module
- class gui.addonStoreGui.viewModels.store.AddonStoreVM
Bases:
object
- onDisplayableError = <extensionPoints.Action object>
An extension point used to notify the add-on store VM when an error occurs that can be displayed to the user.
This allows the add-on store GUI to handle displaying an error.
@param displayableError: Error that can be displayed to the user. @type displayableError: gui.message.DisplayableError
- _downloader = <addonStore.network.AddonFileDownloader object>
- _filteredStatusKey: _StatusFilterKey
Filters the add-on list view model by add-on status. Add-ons with a status in _statusFilters[self._filteredStatusKey] should be displayed in the list.
- _filterChannelKey: Channel
Filters the add-on list view model by add-on channel. Add-ons with a channel in _channelFilters[self._filterChannelKey] should be displayed in the list.
- _filterEnabledDisabled: EnabledStatus
Filters the add-on list view model by enabled or disabled.
- _onSelectedItemChanged()
- _makeActionsList()
- helpAddon(listItemVM: AddonListItemVM) None
- removeAddon(listItemVM: AddonListItemVM[_AddonGUIModel], askConfirmation: bool = True, useRememberChoiceCheckbox: bool = False) tuple[bool, bool]
- removeAddons(listItemVMs: Iterable[AddonListItemVM[_AddonStoreModel]]) None
- classmethod installOverrideIncompatibilityForAddon(listItemVM: AddonListItemVM[_AddonStoreModel], askConfirmation: bool = True, useRememberChoiceCheckbox: bool = False) tuple[bool, bool]
- _enableErrorMessage: str = 'Could not enable the add-on: {addon}.'
- _disableErrorMessage: str = 'Could not disable the add-on: {addon}.'
- _handleEnableDisable(listItemVM: AddonListItemVM[_AddonManifestModel], shouldEnable: bool) None
- enableOverrideIncompatibilityForAddon(listItemVM: AddonListItemVM[_AddonManifestModel], askConfirmation: bool = True, useRememberChoiceCheckbox: bool = False) tuple[bool, bool]
- enableAddon(listItemVM: AddonListItemVM) None
- enableAddons(listItemVMs: Iterable[AddonListItemVM[_AddonStoreModel]]) None
- disableAddon(listItemVM: AddonListItemVM) None
- disableAddons(listItemVMs: Iterable[AddonListItemVM[_AddonStoreModel]]) None
- classmethod replaceAddon(listItemVM: AddonListItemVM, askConfirmation: bool = True, useRememberChoiceCheckbox: bool = False) tuple[bool, bool]
- replaceAddons(listItemVMs: Iterable[AddonListItemVM[_AddonStoreModel]]) None
- classmethod getAddon(listItemVM: AddonListItemVM[_AddonStoreModel]) None
- classmethod getAddons(listItemVMs: Iterable[AddonListItemVM[_AddonStoreModel]]) None
- classmethod _downloadComplete(listItemVM: AddonListItemVM[_AddonStoreModel], fileDownloaded: PathLike | None)
- classmethod installPending()
- classmethod _doInstall(listItemVM: AddonListItemVM, fileDownloaded: PathLike)
- refresh()
- _getAvailableAddonsInBG()
- classmethod cancelDownloads()
- _filterByEnabledKey(model: _AddonGUIModel) bool
- _createListItemVMs() List[AddonListItemVM]