|
11 | 11 | from plone.base.utils import get_installer |
12 | 12 | from Products.CMFPlone.controlpanel.browser.quickinstaller import InstallerView |
13 | 13 | from Products.GenericSetup import EXTENSION |
| 14 | +from typing import Any |
14 | 15 | from zope.component import getAllUtilitiesRegisteredFor |
15 | 16 | from zope.globalrequest import getRequest |
16 | 17 |
|
@@ -94,7 +95,7 @@ def _get_non_installable_addons() -> NonInstallableAddons: |
94 | 95 |
|
95 | 96 |
|
96 | 97 | @lru_cache(maxsize=1) |
97 | | -def _cached_addons() -> tuple[tuple[str, AddonInformation]]: |
| 98 | +def _cached_addons() -> tuple[tuple[str, AddonInformation], ...]: |
98 | 99 | """Return information about add-ons in this installation. |
99 | 100 |
|
100 | 101 | :returns: Tuple of tuples with add-on id and AddonInformation. |
@@ -130,7 +131,7 @@ def _cached_addons() -> tuple[tuple[str, AddonInformation]]: |
130 | 131 | profile_type = pid_parts[-1] |
131 | 132 | if product_id not in addons: |
132 | 133 | # get some basic information on the product |
133 | | - product = { |
| 134 | + product: dict[str, Any] = { |
134 | 135 | "id": product_id, |
135 | 136 | "version": get_version(product_id), |
136 | 137 | "title": product_id, |
@@ -271,10 +272,10 @@ def get(addon: str) -> AddonInformation: |
271 | 272 | :returns: Add-on information. |
272 | 273 | :rtype: string |
273 | 274 | """ |
274 | | - addons = dict(_cached_addons()) |
| 275 | + addons: dict[str, AddonInformation] = dict(_cached_addons()) |
275 | 276 | if addon not in addons: |
276 | 277 | raise InvalidParameterError(f"No add-on {addon} found.") |
277 | | - return _update_addon_info(addons.get(addon), _get_installer()) |
| 278 | + return _update_addon_info(addons[addon], _get_installer()) |
278 | 279 |
|
279 | 280 |
|
280 | 281 | @required_parameters("addon") |
|
0 commit comments