aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/NimManager.py
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-06-24 11:30:39 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-06-24 11:30:39 +0000
commit3b898971c9e352bec83dfcab5b9d6ae3534df719 (patch)
treeeb731a8483b1848176cd9c2d35192a05abe5322d /lib/python/Components/NimManager.py
parentbf0b808b065eba06098281126d68f4d344bff6d5 (diff)
downloadenigma2-3b898971c9e352bec83dfcab5b9d6ae3534df719.tar.gz
enigma2-3b898971c9e352bec83dfcab5b9d6ae3534df719.zip
parse new option in /proc/bus/nim_sockets (Has_Outputs: <yes/no>) to check if a nim has an output connector
Diffstat (limited to 'lib/python/Components/NimManager.py')
-rw-r--r--lib/python/Components/NimManager.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py
index 4865989d..a63a9c83 100644
--- a/lib/python/Components/NimManager.py
+++ b/lib/python/Components/NimManager.py
@@ -357,7 +357,7 @@ class SecConfigure:
self.update()
class NIM(object):
- def __init__(self, slot, type, description):
+ def __init__(self, slot, type, description, has_outputs = True):
self.slot = slot
if type not in ["DVB-S", "DVB-C", "DVB-T", "DVB-S2", None]:
@@ -366,6 +366,7 @@ class NIM(object):
self.type = type
self.description = description
+ self.has_outputs = has_outputs
def isCompatible(self, what):
compatible = {
@@ -387,6 +388,9 @@ class NIM(object):
def getSlotID(self):
return chr(ord('A') + self.slot)
+
+ def hasOutputs(self):
+ return self.has_outputs
slot_id = property(getSlotID)
@@ -519,6 +523,9 @@ class NimManager:
entries[current_slot]["type"] = str(line.strip()[6:])
elif line.strip().startswith("Name:"):
entries[current_slot]["name"] = str(line.strip()[6:])
+ elif line.strip().startswith("Has_Outputs:"):
+ input = str(line.strip()[6:])
+ entries[current_slot]["has_outputs"] = (input == "yes")
elif line.strip().startswith("empty"):
entries[current_slot]["type"] = None
entries[current_slot]["name"] = _("N/A")
@@ -528,7 +535,9 @@ class NimManager:
if not (entry.has_key("name") and entry.has_key("type")):
entry["name"] = _("N/A")
entry["type"] = None
- self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"]))
+ if not (entry.has_key("has_outputs")):
+ entry["has_outputs"] = True
+ self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"]))
def hasNimType(self, chktype):
for slot in self.nim_slots:
@@ -558,6 +567,12 @@ class NimManager:
for slot in self.nim_slots:
list.append(slot.friendly_full_description)
return list
+
+ def hasOutputs(self, slotid):
+ return self.nim_slots[slotid].hasOutputs()
+
+ def getNimConfig(self, slotid):
+ return config.Nims[slotid]
def getSatList(self):
return self.satList