X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fprintcolors.py;h=02342c056a8e6087fda6b6e89ca66e008c73f73a;hb=606f9b6618e0e0659d4029c607eaa04d9b3501cc;hp=52d41f641c5d3582967a938502a69bf3fd236ee3;hpb=4f84485a534ccc2161fbcb42705bb4acfc1db372;p=tools%2Fsat.git diff --git a/src/printcolors.py b/src/printcolors.py index 52d41f6..02342c0 100644 --- a/src/printcolors.py +++ b/src/printcolors.py @@ -18,6 +18,7 @@ '''In this file is stored the mechanism that manage color prints in the terminal ''' + # define constant to use in scripts COLOR_ERROR = 'ERROR' COLOR_WARNING = 'WARNING' @@ -153,11 +154,25 @@ def print_value(logger, label, value, level=1, suffix=""): :param level int: the level of verboseness. :param suffix str: the suffix to add at the end. ''' + if type(value) is list: + skip = "\n " + strValue = "" + i = 0 + for v in value: + strValue += "%15s, " % str(v) + i += 1 + if i >= 5: + strValue += skip + i = 0 + if len(value) > 5: + strValue = skip + strValue + else: + strValue = str(value) + strValue = printcInfo(strValue) if logger is None: - print(" %s = %s %s" % (label, printcInfo(str(value)), suffix)) + print(" %s = %s %s" % (label, strValue, suffix)) else: - logger.write(" %s = %s %s\n" % (label, printcInfo(str(value)), - suffix), level) + logger.write(" %s = %s %s\n" % (label, strValue, suffix), level) def print_color_range(start, end): '''print possible range values for colors