From 326b4d70d52ff5af3c7a78cce236fb54c1d048f1 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 20 May 2012 17:20:46 +0200 Subject: [PATCH] Renamed gather() to update() in disk_mon.py --- disk_mon.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/disk_mon.py b/disk_mon.py index a7f49af..83e2af2 100755 --- a/disk_mon.py +++ b/disk_mon.py @@ -1,25 +1,21 @@ #!/usr/bin/python2 -# -# disk monitor -# - -#imports -import os - +""" disk monitor """ class diskmon(object): """collect information about local partitions""" def __init__(self): - self.gather() + self.update() - def gather(self): - """gather the actual information""" + def update(self): + """run collection of data""" - self.partitions = [] #information about all partitions (list of lists) - uuids = os.listdir("/dev/disk/by-uuid") #folder contains symlinks to the actual disk devices - for uuid in uuids: #write /dev/names as keys and uuids as values in the dictionary + import os + + self.partitions = [] + uuids = os.listdir("/dev/disk/by-uuid") + for uuid in uuids: part = {} part["device"] = str("/dev/" + os.readlink("/dev/disk/by-uuid/" + uuid)[6:]) part["uuid"] = uuid