projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41a6eb9
)
Use standard unit symbols in format_bytes
author
Alexander van Gessel
<AI0867@gmail.com>
Sat, 20 Apr 2013 23:38:37 +0000
(
02:38
+0300)
committer
Alexander van Gessel
<AI0867@gmail.com>
Sat, 20 Apr 2013 23:38:37 +0000
(
02:38
+0300)
youtube_dl/FileDownloader.py
patch
|
blob
|
history
diff --git
a/youtube_dl/FileDownloader.py
b/youtube_dl/FileDownloader.py
index 9c0c42f8d44ab5a85df6fd68f272869ca546f940..19766153c477dd7a90bb3282ec51c9ea1001274e 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)