From fd836bf57893c4bc49aaf50f6954401fb8f63b2d Mon Sep 17 00:00:00 2001 From: David Date: Wed, 16 May 2012 17:32:04 +0200 Subject: [PATCH] writing better dev names as keys for diezweite --- diskusage_diezweite.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diskusage_diezweite.py b/diskusage_diezweite.py index 2c2a966..f14546b 100755 --- a/diskusage_diezweite.py +++ b/diskusage_diezweite.py @@ -7,9 +7,9 @@ import os # getting all local partitions plus their uuids def getpartitions(): uuids = os.listdir("/dev/disk/by-uuid") #folder contains symlinks to the actual disk devices - parts = {} #initializing empty dictionary for partition labels/names and uuids - for uuid in uuids: #write labels/names as keys and uuids as values in the dictionary - parts[os.readlink("/dev/disk/by-uuid/" + uuid)[6:]] = uuid + parts = {} #initializing empty dictionary for partitions and uuids + for uuid in uuids: #write /dev/names as keys and uuids as values in the dictionary + parts["/dev/" + os.readlink("/dev/disk/by-uuid/" + uuid)[6:]] = uuid return parts #return the dictionary for further useage