removing old py2 syntax
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- 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 str
|
||||
from past.utils import old_div
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
@@ -345,7 +340,7 @@ def get_md5(filename,fullfile=False):
|
||||
anim_i=0
|
||||
anim_len=len(ANIM)
|
||||
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()
|
||||
with open(filename,'rb') as f:
|
||||
for chunk in iter(lambda: f.read(block_size), b''):
|
||||
@@ -433,7 +428,7 @@ def humanize_size(size,precision=1):
|
||||
defPrecision=0
|
||||
while size > 1024:
|
||||
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
|
||||
return "%.*f%s"%(defPrecision,size,suffixes[suffixIndex])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user