socialnerds/hive
socialnerds
/
hive
Archived
1
0
Fork 0

generating now a dictionary for mountpoints in diskusage.py

This commit is contained in:
David 2012-05-17 12:21:16 +02:00
parent 57ff13f9df
commit f92974c8b0
1 changed files with 4 additions and 7 deletions

View File

@ -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 "------------------------------"