diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-27 10:39:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-27 10:39:56 +0000 |
commit | eeeaff8afe94b2806a79a02b7c01c912a984a22f (patch) | |
tree | 97983910e3beb2f21c346165f69f3fc57a411b15 /ptpython/style.py | |
parent | Adding upstream version 3.0.22. (diff) | |
download | ptpython-eeeaff8afe94b2806a79a02b7c01c912a984a22f.tar.xz ptpython-eeeaff8afe94b2806a79a02b7c01c912a984a22f.zip |
Adding upstream version 3.0.23.upstream/3.0.23
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ptpython/style.py')
-rw-r--r-- | ptpython/style.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ptpython/style.py b/ptpython/style.py index 4b54d0c..199d5ab 100644 --- a/ptpython/style.py +++ b/ptpython/style.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict from prompt_toolkit.styles import BaseStyle, Style, merge_styles @@ -8,11 +10,11 @@ from pygments.styles import get_all_styles, get_style_by_name __all__ = ["get_all_code_styles", "get_all_ui_styles", "generate_style"] -def get_all_code_styles() -> Dict[str, BaseStyle]: +def get_all_code_styles() -> dict[str, BaseStyle]: """ Return a mapping from style names to their classes. """ - result: Dict[str, BaseStyle] = { + result: dict[str, BaseStyle] = { name: style_from_pygments_cls(get_style_by_name(name)) for name in get_all_styles() } @@ -20,7 +22,7 @@ def get_all_code_styles() -> Dict[str, BaseStyle]: return result -def get_all_ui_styles() -> Dict[str, BaseStyle]: +def get_all_ui_styles() -> dict[str, BaseStyle]: """ Return a dict mapping {ui_style_name -> style_dict}. """ |