extraction size convert function from src/searchfile.py
author“Alexandr <“popov2al@gmail.com”>
Wed, 1 Apr 2009 18:57:32 +0000 (22:57 +0400)
committer“Alexandr <“popov2al@gmail.com”>
Wed, 1 Apr 2009 18:57:32 +0000 (22:57 +0400)
src/searchfile.py

index c4000aa..0f09f5f 100644 (file)
@@ -34,13 +34,6 @@ class Search_File_Abstraction(object):
     
     def __init__(self, ignore_dirs):
         self.ignore_dirs = ignore_dirs
-        
-    def size_convert(self, size):
-        """Return string with file size in b or Kb or Mb or Gb or Tb."""
-        for i, unit in enumerate(['%d b', '%.1f Kb', '%.2f Mb', '%.3f Gb', '%.4f Tb']):
-            if size < 1024**(i+1):
-                return unit % (size/1024.**i)
-        return '>1024 Tb'
 
     def filegetter(self, startdir, get_stopit, label):
         """Generator of file sizes and paths based on os.walk."""