summaryrefslogtreecommitdiffstats
path: root/cli_helpers/compat.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-21 19:32:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-21 19:33:02 +0000
commitf18c637c042eec4678a79729a0e67da99017c465 (patch)
tree3080af2ff20756431ed8a71821febecbd1be3b2a /cli_helpers/compat.py
parentReleasing debian version 2.2.0-1. (diff)
downloadcli-helpers-f18c637c042eec4678a79729a0e67da99017c465.tar.xz
cli-helpers-f18c637c042eec4678a79729a0e67da99017c465.zip
Merging upstream version 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.py14
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)