projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
75b5c59
)
Merge pull request #797 from AI0867/patch-1
author
Philipp Hagemeister
<phihag@phihag.de>
Mon, 22 Apr 2013 21:13:52 +0000
(14:13 -0700)
committer
Philipp Hagemeister
<phihag@phihag.de>
Mon, 22 Apr 2013 21:13:52 +0000
(14:13 -0700)
Use standard unit symbols in format_bytes
youtube_dl/FileDownloader.py
patch
|
blob
|
history
diff --git
a/youtube_dl/FileDownloader.py
b/youtube_dl/FileDownloader.py
index 7139adf6bb6490b31dc3661b0fc220df30b0dad2..100779756d956033ace52742d9be3ef13b821323 100644
(file)
--- a/
youtube_dl/FileDownloader.py
+++ b/
youtube_dl/FileDownloader.py
@@
-121,7
+121,7
@@
class FileDownloader(object):
exponent = 0
else:
exponent = int(math.log(bytes, 1024.0))
- suffix =
'bkMGTPEZY'
[exponent]
+ suffix =
['B','KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB']
[exponent]
converted = float(bytes) / float(1024 ** exponent)
return '%.2f%s' % (converted, suffix)