diff options
author | Christian Geier <geier@lostpackets.de> | 2023-10-30 00:12:32 +0100 |
---|---|---|
committer | Christian Geier <geier@lostpackets.de> | 2024-04-12 14:25:40 +0200 |
commit | 0ab2021da9e528758c212f666f7c3948f91e9088 (patch) | |
tree | 298d6c6a285263057a01ec521e1e74d7c396f6bb | |
parent | 89bfd10c21fefb4f080ffb9fcb1936742bc62600 (diff) |
import type hints from typing, not collections
doesn't seem to work with python 3.8 otherwise
-rw-r--r-- | khal/plugins.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/khal/plugins.py b/khal/plugins.py index c9fe37b1..eda52fe2 100644 --- a/khal/plugins.py +++ b/khal/plugins.py @@ -1,5 +1,4 @@ -from collections.abc import Callable, Mapping -from typing import Dict, List, Tuple +from typing import Callable, Dict, List, Mapping, Tuple from khal._compat import importlib_metadata @@ -9,7 +8,7 @@ from khal._compat import importlib_metadata # https://setuptools.pypa.io/en/latest/userguide/entry_point.html -def _load_formatters() -> dict[str, Callable[[str], str]]: +def _load_formatters() -> Dict[str, Callable[[str], str]]: formatter_entrypoints = importlib_metadata.entry_points(group="khal.formatter") return {ep.name: ep.load() for ep in formatter_entrypoints} @@ -22,8 +21,9 @@ def _load_color_themes() -> Dict[str, List[Tuple[str, ...]]]: THEMES: Dict[str, List[Tuple[str, ...]],] = _load_color_themes() -def _load_commands() -> dict[str, Callable]: + +def _load_commands() -> Dict[str, Callable]: command_entrypoints = importlib_metadata.entry_points(group="khal.commands") return {ep.name: ep.load() for ep in command_entrypoints} -COMMANDS: dict[str, Callable] = _load_commands() +COMMANDS: Dict[str, Callable] = _load_commands() |