File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2323"""
2424
2525from __future__ import print_function
26+ from math import ceil
2627
2728__version__ = "0.01.38"
2829__author__ = "nagev"
@@ -1345,15 +1346,21 @@ def make_status_line(match_object):
13451346 pct = (current / total * 100 )
13461347
13471348 except ZeroDivisionError :
1348- pct = '?'
1349+ pct = 0
13491350
1350- return " %s%s%s (%.0f%%) " % (
1351+ status_line = " %s%s%s %s " % (
13511352 match_object .group ('elapsed_h' ) or '' ,
13521353 match_object .group ('elapsed_m' ) or '00:' ,
13531354 match_object .group ('elapsed_s' ),
1354- pct
1355+ ( "(%.0f%%)" % pct ). ljust ( 6 )
13551356 )
13561357
1358+ progress_bar_size = 30
1359+ progress = int (ceil (pct / 100 * progress_bar_size ))
1360+ status_line += " [%s]" % ("=" * (progress - 1 ) + ">" ).ljust (progress_bar_size , '.' )
1361+
1362+ return status_line
1363+
13571364
13581365def _search (url , progtext , qs = None , splash = True ):
13591366 """ Perform memoized url fetch, display progtext. """
You can’t perform that action at this time.
0 commit comments