From e2df02000fda407880c68c1ebd97a217ed0356d7 Mon Sep 17 00:00:00 2001 From: ccremers Date: Wed, 2 Mar 2005 20:12:06 +0000 Subject: [PATCH] - Added options to supress the progress bar with e.g. -B --- test/multiprotocoltest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/multiprotocoltest.py b/test/multiprotocoltest.py index 0e1dfa9..fd18dd7 100755 --- a/test/multiprotocoltest.py +++ b/test/multiprotocoltest.py @@ -229,6 +229,8 @@ def ShowProgress (i,n,txt): def IntegerPart (x): return int (( x * i ) / n) + if not options.progressbar: + return percentage = IntegerPart (100) factor = IntegerPart (ProgressBarWidth) @@ -253,6 +255,8 @@ def ShowProgress (i,n,txt): LastProgress[n] = (factor, txt) def ClearProgress (n,txt): + if not options.progressbar: + return bar = " " * (1 + ProgressBarWidth + 2 + 5 + len(txt)) sys.stderr.write("\r" + bar + "\r") sys.stderr.flush() @@ -454,6 +458,10 @@ parser.add_option("-b","--bounds", dest="bounds", parser.add_option("-s","--start", dest="startpercentage", default = 0, help = "start test at a certain percentage") +parser.add_option("-B","--disable-progressbar", dest="progressbar", + default = "True", + action = "store_false", + help = "suppress a progress bar") (options, args) = parser.parse_args()