diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2009-03-23 13:25:00 +0100 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2009-03-23 13:25:06 +0100 |
| commit | f9259c898537d2c5f5722b9c6d8a9217ee5799ae (patch) | |
| tree | 11f6892d2e559465e29d23b5f3dab9c89402e4b0 /lib/python/Components | |
| parent | 0c7eeca673a4b1bda346b472badabcb67f8c2908 (diff) | |
| download | enigma2-f9259c898537d2c5f5722b9c6d8a9217ee5799ae.tar.gz enigma2-f9259c898537d2c5f5722b9c6d8a9217ee5799ae.zip | |
improve /sys/block/*/stat parsing
Diffstat (limited to 'lib/python/Components')
| -rwxr-xr-x | lib/python/Components/Harddisk.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 8664f79a..37905b7d 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() |
