mirror of
https://github.com/optim-enterprises-bv/nDPId.git
synced 2025-10-30 01:42:22 +00:00
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>
This commit is contained in:
22
dependencies/nDPIsrvd.py
vendored
22
dependencies/nDPIsrvd.py
vendored
@@ -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]),
|
||||
@@ -51,6 +51,17 @@ class TermColor:
|
||||
(Fore.LIGHTWHITE_EX, [Back.LIGHTBLACK_EX, Back.BLACK]),
|
||||
(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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user