X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e68a1617b7c1efbedf8b28309943dd7669daaad0..89b408592c0f5756b0049a60832761646477cfa0:/lib/python/Components/Harddisk.py?ds=sidebyside diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 8664f79a..ad6c1a3b 100755 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -230,9 +230,8 @@ class Harddisk: # 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() @@ -456,11 +455,10 @@ class HarddiskManager: 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