@@ -95,7 +95,6 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
9595 showEta = conf .eta and isinstance (length , int )
9696 numThreads = min (conf .threads , length )
9797 threads = []
98- totalWidth = 54
9998
10099 if showEta :
101100 progress = ProgressBar (maxValue = length )
@@ -106,7 +105,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
106105 infoMsg = "starting %d threads" % numThreads
107106 logger .info (infoMsg )
108107
109- dataToStdout ("[%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), "_" * min (length , totalWidth )))
108+ dataToStdout ("[%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), "_" * min (length , conf . progressWidth )))
110109 dataToStdout ("\r [%s] [INFO] retrieved: " % time .strftime ("%X" ))
111110 else :
112111 dataToStdout ("[%s] [INFO] retrieved: " % time .strftime ("%X" ))
@@ -191,16 +190,16 @@ def downloadThread():
191190 if value [i ] is not None :
192191 endCharIndex = max (endCharIndex , i )
193192 output = ''
194- if endCharIndex > totalWidth :
195- startCharIndex = endCharIndex - totalWidth
193+ if endCharIndex > conf . progressWidth :
194+ startCharIndex = endCharIndex - conf . progressWidth
196195 count = 0
197196 for i in xrange (startCharIndex , endCharIndex ):
198197 output += '_' if value [i ] is None else value [i ]
199198 for i in xrange (length ):
200199 count += 1 if value [i ] is not None else 0
201200 if startCharIndex > 0 :
202201 output = '...' + output [3 :]
203- if endCharIndex - startCharIndex == totalWidth :
202+ if endCharIndex - startCharIndex == conf . progressWidth :
204203 output = output [:- 3 ] + '...'
205204 status = ' %d/%d' % (count , length )
206205 output += status if count != length else " " * len (status )
0 commit comments