nicer output in disk display
This commit is contained in:
parent
4e3aee7738
commit
c2dd867ae3
|
@ -26,9 +26,12 @@ if __name__ == "__main__":
|
|||
if partition.has_key("mountpoint"):
|
||||
totalbytes = blocks2bytes(partition["total blocks"], partition["blocksize"])
|
||||
totalhuman = bytes2human(totalbytes)
|
||||
freebytes = blocks2bytes(partition["free blocks"], partition["blocksize"])
|
||||
freehuman = bytes2human(freebytes)
|
||||
percent = 100.00 * freebytes / totalbytes
|
||||
print "Mountpoint:\t" + str(partition["mountpoint"]) + \
|
||||
"\nFilesystem:\t" + str(partition["filesystem"]) + \
|
||||
"\nSize:\t\t%.2f %s\n" %(totalhuman[0], totalhuman[1])
|
||||
"\nUsage:\t\t%.2f%s/%.2f%s(%i)\n" %(freehuman[0], freehuman[1], totalhuman[0], totalhuman[1], percent)
|
||||
else:
|
||||
print "\n"
|
||||
|
||||
|
|
Reference in New Issue