# we set the hdd into standby.
def readStats(self):
l = open("/sys/block/%s/stat" % self.device).read()
- nr_read = int(l[:8].strip())
- nr_write = int(l[4*9:4*9+8].strip())
- return nr_read, nr_write
+ (nr_read, _, _, _, nr_write) = l.split()[:5]
+ return int(nr_read), int(nr_write)
def startIdle(self):
self.last_access = time.time()
self.on_partition_list_change("remove", x)
l = len(device)
if l and not device[l-1].isdigit():
- idx = 0
for hdd in self.hdd:
if hdd.device == device:
- self.hdd[x].stop()
- del self.hdd[idx]
+ hdd.stop()
+ self.hdd.remove(hdd)
break
SystemInfo["Harddisk"] = len(self.hdd) > 0