projects
/
mdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f5c65d4
)
Progress hook does not finish on a greater value than total
author
Frederic Massart
<fred@moodle.com>
Mon, 9 Sep 2013 10:15:40 +0000
(18:15 +0800)
committer
Frederic Massart
<fred@moodle.com>
Mon, 9 Sep 2013 10:15:40 +0000
(18:15 +0800)
lib/tools.py
patch
|
blob
|
history
diff --git
a/lib/tools.py
b/lib/tools.py
index
3d85ab8
..
a70c0e4
100644
(file)
--- a/
lib/tools.py
+++ b/
lib/tools.py
@@
-116,6
+116,8
@@
def downloadProcessHook(count, size, total):
"""Hook to report the downloading a file using urllib.urlretrieve"""
downloaded = int((count * size) / (1024))
total = int(total / (1024)) if total != 0 else '?'
+ if downloaded > total:
+ downloaded = total
sys.stderr.write("\r %sKB / %sKB" % (downloaded, total))
sys.stderr.flush()