git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0c7eeca
)
improve /sys/block/*/stat parsing
author
Felix Domke
<tmbinc@elitedvb.net>
Mon, 23 Mar 2009 12:25:00 +0000
(13:25 +0100)
committer
Felix Domke
<tmbinc@elitedvb.net>
Mon, 23 Mar 2009 12:25:06 +0000
(13:25 +0100)
lib/python/Components/Harddisk.py
patch
|
blob
|
history
diff --git
a/lib/python/Components/Harddisk.py
b/lib/python/Components/Harddisk.py
index 8664f79a48b7cc6a980122d4a04faf3a1699f5ff..37905b7d70ee03f5af70dfc5d9babc3a82010cb5 100755
(executable)
--- 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()