Remove obsolete convert_size function
authorAntoine Busque <abusque@efficios.com>
Fri, 15 Jan 2016 21:54:33 +0000 (16:54 -0500)
committerAntoine Busque <abusque@efficios.com>
Thu, 11 Feb 2016 18:58:52 +0000 (13:58 -0500)
Signed-off-by: Antoine Busque <abusque@efficios.com>
lttnganalyses/linuxautomaton/common.py

index c4525317c07dce47a6d3c2a4686338aab05cc874..17b4dcab262711f44564cdba2a31e77d96bd653f 100644 (file)
@@ -20,7 +20,6 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-import math
 import re
 import time
 import datetime
@@ -50,32 +49,6 @@ def get_syscall_name(event):
     return name[14:]
 
 
-def convert_size(size, padding_after=False, padding_before=False):
-    if padding_after and size < 1024:
-        space_after = ' '
-    else:
-        space_after = ''
-    if padding_before and size < 1024:
-        space_before = ' '
-    else:
-        space_before = ''
-    if size <= 0:
-        return '0 ' + space_before + 'B' + space_after
-    size_name = ('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB')
-    i = int(math.floor(math.log(size, 1024)))
-    p = math.pow(1024, i)
-    s = round(size/p, 2)
-    if s > 0:
-        try:
-            v = '%0.02f' % s
-            return '%s %s%s%s' % (v, space_before, size_name[i], space_after)
-        except:
-            print(i, size_name)
-            raise Exception('Too big to be true')
-    else:
-        return '0 B'
-
-
 def is_multi_day_trace_collection(handles):
     time_begin = None
 
This page took 0.025433 seconds and 5 git commands to generate.