aboutsummaryrefslogtreecommitdiff
path: root/dependencies/nDPIsrvd.py
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-09-22 02:33:04 +0200
committerToni Uhlig <matzeton@googlemail.com>2022-09-22 08:00:21 +0200
commit28971cd7647a79253000fb33e52b5d2129e5ba62 (patch)
tree9ff512cfb3b1d2c877d8f6899b9c1f427f6d2a30 /dependencies/nDPIsrvd.py
parent3c7bd6a4ba410729a8b91dffaaf4a08bedc67036 (diff)
flow-info.py: Command line arguments --no-color, --no-statusbar (both useful for tests/CI) and --print-analyse-results.
* run_tests.sh: Use flow-info.py for additional DIFF tests. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'dependencies/nDPIsrvd.py')
-rw-r--r--dependencies/nDPIsrvd.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/dependencies/nDPIsrvd.py b/dependencies/nDPIsrvd.py
index 4bb0f451a..aa395bf06 100644
--- a/dependencies/nDPIsrvd.py
+++ b/dependencies/nDPIsrvd.py
@@ -28,12 +28,12 @@ PKT_TYPE_ETH_IP6 = 0x86DD
class TermColor:
- HINT = '\033[33m'
+ HINT = '\033[33m'
WARNING = '\033[93m'
- FAIL = '\033[91m'
- BOLD = '\033[1m'
- END = '\033[0m'
- BLINK = '\x1b[5m'
+ FAIL = '\033[91m'
+ BOLD = '\033[1m'
+ END = '\033[0m'
+ BLINK = '\x1b[5m'
if USE_COLORAMA is True:
COLOR_TUPLES = [ (Fore.BLUE, [Back.RED, Back.MAGENTA, Back.WHITE]),
@@ -52,6 +52,17 @@ class TermColor:
(Fore.LIGHTYELLOW_EX, [Back.LIGHTRED_EX, Back.RED]) ]
@staticmethod
+ def disableColor():
+ TermColor.HINT = ''
+ TermColor.WARNING = ''
+ TermColor.FAIL = ''
+ TermColor.BOLD = ''
+ TermColor.END = ''
+ TermColor.BLINK = ''
+ global USE_COLORAMA
+ USE_COLORAMA = False
+
+ @staticmethod
def calcColorHash(string):
h = 0
for char in string:
@@ -68,6 +79,7 @@ class TermColor:
@staticmethod
def setColorByString(string):
+ global USE_COLORAMA
if USE_COLORAMA is True:
fg_color, bg_color = TermColor.getColorsByHash(string)
color_hash = TermColor.calcColorHash(string)