git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of fraxinas@git.opendreambox.org:/git/enigma2
[enigma2.git]
/
lib
/
python
/
Components
/
Harddisk.py
diff --git
a/lib/python/Components/Harddisk.py
b/lib/python/Components/Harddisk.py
index dfc262d84b889407dcd81c41df5429f3a8980be1..febd16dd50678ab6361a5c23378769081b6a6f27 100644
(file)
--- a/
lib/python/Components/Harddisk.py
+++ b/
lib/python/Components/Harddisk.py
@@
-19,20
+19,22
@@
class Harddisk:
s_minor = int(tmp[1])
for disc in listdir("/dev/discs"):
path = readlink('/dev/discs/'+disc)
s_minor = int(tmp[1])
for disc in listdir("/dev/discs"):
path = readlink('/dev/discs/'+disc)
- devidex = '/dev'+path[2:]+'/'
- disc = devidex+'disc'
+ devidex = '/dev/discs/'+disc+'/'
+ devidex2 = '/dev'+path[2:]+'/'
+ disc = devidex2+'disc'
ret = stat(disc).st_rdev
if s_major == major(ret) and s_minor == minor(ret):
self.devidex = devidex
ret = stat(disc).st_rdev
if s_major == major(ret) and s_minor == minor(ret):
self.devidex = devidex
- print "new Harddisk", device, self.devidex
+ self.devidex2 = devidex2
+ print "new Harddisk", device, '->', self.devidex, '->', self.devidex2
break
def __lt__(self, ob):
return self.device < ob.device
def bus(self):
break
def __lt__(self, ob):
return self.device < ob.device
def bus(self):
- ide_cf = self.device.find("hd") == 0 and self.devidex.find("host0") == -1 # 7025 specific
- internal = self.device.find("hd") == 0
and self.devidex
+ ide_cf = self.device.find("hd") == 0 and self.devidex
2
.find("host0") == -1 # 7025 specific
+ internal = self.device.find("hd") == 0
if ide_cf:
ret = "External (CF)"
elif internal:
if ide_cf:
ret = "External (CF)"
elif internal:
@@
-248,7
+250,7
@@
class Partition:
class HarddiskManager:
def __init__(self):
self.hdd = [ ]
class HarddiskManager:
def __init__(self):
self.hdd = [ ]
-
+ self.cd = ""
self.partitions = [ ]
self.on_partition_list_change = CList()
self.partitions = [ ]
self.on_partition_list_change = CList()
@@
-301,6
+303,8
@@
class HarddiskManager:
if partition[0:len(blockdev)] != blockdev:
continue
partitions.append(partition)
if partition[0:len(blockdev)] != blockdev:
continue
partitions.append(partition)
+ else:
+ self.cd = blockdev
except IOError:
error = True
return error, blacklisted, removable, is_cdrom, partitions
except IOError:
error = True
return error, blacklisted, removable, is_cdrom, partitions
@@
-363,6
+367,9
@@
class HarddiskManager:
list.append((hdd, hd))
return list
list.append((hdd, hd))
return list
+ def getCD(self):
+ return self.cd
+
def getMountedPartitions(self, onlyhotplug = False):
return [x for x in self.partitions if (x.is_hotplug or not onlyhotplug) and x.mounted()]
def getMountedPartitions(self, onlyhotplug = False):
return [x for x in self.partitions if (x.is_hotplug or not onlyhotplug) and x.mounted()]