diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-21 19:32:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-21 19:32:47 +0000 |
commit | 25c7ffdc95b7b004e20e7a60d2fc703cb666e193 (patch) | |
tree | 79d34fe43a4ee9b66057c90a986fd6577c997fc1 /cli_helpers/compat.py | |
parent | Adding upstream version 2.2.0. (diff) | |
download | cli-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/compat.py')
-rw-r--r-- | cli_helpers/compat.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli_helpers/compat.py b/cli_helpers/compat.py index c938851..422403c 100644 --- a/cli_helpers/compat.py +++ b/cli_helpers/compat.py @@ -2,6 +2,7 @@ """OS and Python compatibility support.""" from decimal import Decimal +from types import SimpleNamespace import sys PY2 = sys.version_info[0] == 2 @@ -34,9 +35,22 @@ else: HAS_PYGMENTS = True try: + from pygments.token import Token from pygments.formatters.terminal256 import Terminal256Formatter except ImportError: HAS_PYGMENTS = False Terminal256Formatter = None + Token = SimpleNamespace() + Token.Output = SimpleNamespace() + Token.Output.Header = None + Token.Output.OddRow = None + Token.Output.EvenRow = None + Token.Output.Null = None + Token.Output.TableSeparator = None + Token.Results = SimpleNamespace() + Token.Results.Header = None + Token.Results.OddRow = None + Token.Results.EvenRow = None + float_types = (float, Decimal) |