removing old py2 syntax
This commit is contained in:
@@ -1,12 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: latin-1 -*-
|
# -*- coding: latin-1 -*-
|
||||||
from __future__ import division
|
|
||||||
from __future__ import print_function
|
|
||||||
from future import standard_library
|
|
||||||
standard_library.install_aliases()
|
|
||||||
from builtins import zip
|
from builtins import zip
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from past.utils import old_div
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
@@ -345,7 +340,7 @@ def get_md5(filename,fullfile=False):
|
|||||||
anim_i=0
|
anim_i=0
|
||||||
anim_len=len(ANIM)
|
anim_len=len(ANIM)
|
||||||
block_size=2**24
|
block_size=2**24
|
||||||
percents_per_block=old_div(100,(old_div(float(fsize),block_size)))
|
percents_per_block=int(100/(float(fsize)/block_size))
|
||||||
md5 = hashlib.md5()
|
md5 = hashlib.md5()
|
||||||
with open(filename,'rb') as f:
|
with open(filename,'rb') as f:
|
||||||
for chunk in iter(lambda: f.read(block_size), b''):
|
for chunk in iter(lambda: f.read(block_size), b''):
|
||||||
@@ -433,7 +428,7 @@ def humanize_size(size,precision=1):
|
|||||||
defPrecision=0
|
defPrecision=0
|
||||||
while size > 1024:
|
while size > 1024:
|
||||||
suffixIndex += 1 #increment the index of the suffix
|
suffixIndex += 1 #increment the index of the suffix
|
||||||
size = old_div(size,1024.0) #apply the division
|
size = float(size/1024.0) #apply the division
|
||||||
defPrecision=precision
|
defPrecision=precision
|
||||||
return "%.*f%s"%(defPrecision,size,suffixes[suffixIndex])
|
return "%.*f%s"%(defPrecision,size,suffixes[suffixIndex])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user