generating now a dictionary for mountpoints in diskusage.py
This commit is contained in:
parent
57ff13f9df
commit
f92974c8b0
11
diskusage.py
11
diskusage.py
|
@ -60,24 +60,21 @@ partitions = partsnew
|
|||
blocks = blocksnew
|
||||
|
||||
# getting mounted partitions and their mountpoints
|
||||
mountpoints = []
|
||||
mountparts = []
|
||||
mountpoints = {}
|
||||
for item in partitions:
|
||||
for line in mounts.split("\n"):
|
||||
if line and item in line:
|
||||
mountpoints.append(line.split()[1])
|
||||
mountparts.append(item)
|
||||
mountpoints[item]=line.split()[1]
|
||||
break
|
||||
|
||||
# output for debugging
|
||||
print "debug output:"
|
||||
print "availible partitions: %s\nblocks: %s\nmounted partitions: %s\nmountpoints: %s" %(partitions, blocks, mountparts, mountpoints)
|
||||
print "availible partitions: %s\nblocks: %s\nmounts: %s" %(partitions, blocks, mountpoints)
|
||||
print "" #linebreak
|
||||
|
||||
|
||||
# given paths(mountpoints)
|
||||
#path=("/boot", "/", "/dev/sda6")
|
||||
path = mountpoints
|
||||
path = mountpoints.values()
|
||||
|
||||
print "mountpoints\tfree megabytes"
|
||||
print "------------------------------"
|
||||
|
|
Reference in New Issue