commit
006359205a
1 changed files with 3 additions and 3 deletions
|
@ -398,10 +398,10 @@ class Recipe(object):
|
||||||
return
|
return
|
||||||
def report_hook(index, blksize, size):
|
def report_hook(index, blksize, size):
|
||||||
if size <= 0:
|
if size <= 0:
|
||||||
progression = '{0} bytes'.format(index * blksize)
|
progression = '{} bytes'.format(index * blksize)
|
||||||
else:
|
else:
|
||||||
progression = '{0:.2f}%'.format(
|
progression = '{:.2%}'.format(
|
||||||
index * blksize * 100. / float(size))
|
index * blksize / float(size))
|
||||||
stdout.write('- Download {}\r'.format(progression))
|
stdout.write('- Download {}\r'.format(progression))
|
||||||
stdout.flush()
|
stdout.flush()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue