Logo Search packages:      
Sourcecode: catfish version File versions  Download package

def catfish::catfish::format_size (   self,
  size 
)
Make a file size human readable.

Definition at line 402 of file catfish.py.

                               :
        """Make a file size human readable."""

        if size > 2 ** 30:
            return '%s GB' % (size / 2 ** 30)
        elif size > 2 ** 20:
            return '%s MB' % (size / 2 ** 20)
        elif size > 2 ** 10:
            return '%s kB' % (size / 2 ** 10)
        elif size > -1:
            return '%s B' % size
        else:
            return ''


Generated by  Doxygen 1.6.0   Back to index