summaryrefslogtreecommitdiffstats
path: root/cli_helpers/utils.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-21 19:32:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-21 19:32:47 +0000
commit25c7ffdc95b7b004e20e7a60d2fc703cb666e193 (patch)
tree79d34fe43a4ee9b66057c90a986fd6577c997fc1 /cli_helpers/utils.py
parentAdding upstream version 2.2.0. (diff)
downloadcli-helpers-25c7ffdc95b7b004e20e7a60d2fc703cb666e193.tar.xz
cli-helpers-25c7ffdc95b7b004e20e7a60d2fc703cb666e193.zip
Adding upstream version 2.2.1.upstream/2.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cli_helpers/utils.py')
-rw-r--r--cli_helpers/utils.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/cli_helpers/utils.py b/cli_helpers/utils.py
index 3f09cb5..053bdea 100644
--- a/cli_helpers/utils.py
+++ b/cli_helpers/utils.py
@@ -104,13 +104,11 @@ def filter_style_table(style: "StyleMeta", *relevant_styles: str) -> Dict:
"""
get a dictionary of styles for given tokens. Typical usage:
- filter_style_table(style, 'Token.Output.EvenRow', 'Token.Output.OddRow') == {
- 'Token.Output.EvenRow': "",
- 'Token.Output.OddRow': "",
+ filter_style_table(style, Token.Output.EvenRow, Token.Output.OddRow) == {
+ Token.Output.EvenRow: "",
+ Token.Output.OddRow: "",
}
"""
- _styles_iter = (
- (str(key), val) for key, val in getattr(style, "styles", {}).items()
- )
+ _styles_iter = ((key, val) for key, val in getattr(style, "styles", {}).items())
_relevant_styles_iter = filter(lambda tpl: tpl[0] in relevant_styles, _styles_iter)
return {key: val for key, val in _relevant_styles_iter}