git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add delete to advanced restore
[enigma2.git]
/
lib
/
python
/
Components
/
Harddisk.py
diff --git
a/lib/python/Components/Harddisk.py
b/lib/python/Components/Harddisk.py
index 8664f79a48b7cc6a980122d4a04faf3a1699f5ff..ad6c1a3b46e5f3f752ebe08e5845b4fa8acfd427 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()
# 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()
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():
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:
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
break
SystemInfo["Harddisk"] = len(self.hdd) > 0