fix nimmanager to display the correct NIMs instead of dummys
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 21 Nov 2005 16:04:04 +0000 (16:04 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 21 Nov 2005 16:04:04 +0000 (16:04 +0000)
lib/python/Components/NimManager.py
po/de.po

index 741233d..05afcbd 100644 (file)
@@ -143,43 +143,38 @@ class NimManager:
                satHandler = self.parseSats(self.satList, self.satellites, self.transponders)
                parser.setContentHandler(satHandler)
                parser.parse('/etc/tuxbox/satellites.xml')
-
-       def getNimType(self, slotID):
-               #FIXME get it from /proc
+               
+       def parseProc(self):
+               self.nimTypes = {}
+               self.nimNames = {}              
                nimfile = tryOpen("/proc/bus/nim_sockets")
 
                if nimfile == "":
-                       # FIXME: remove this in the final version
-                       # check if we have a device for 7020 comp?atibility reasons
-                       try:
-                               open("/dev/dvb/card0/frontend" + str(slotID))
-                               return self.nimType["DVB-S"]
-                       except IOError:
                                return self.nimType["empty/unknown"]
-
+                       
+               lastsocket = -1
 
                while 1:                
                        line = nimfile.readline()
                        if line == "":
                                break
-                       if line.startswith("NIM Socket"):
+                       if line.strip().startswith("NIM Socket"):
                                parts = line.strip().split(" ")
                                id = int(parts[2][:1])
-                               if id == slotID:
-                                       line = nimfile.readline()
-                                       if line == "":
-                                               break
-                                       if line.startswith("   Type:"):
-                                               nimfile.close()
-                                               return self.nimType["DVB-S"]
-                                       else:
-                                               break   
+                               lastsocket = int(id)
+                       elif line.strip().startswith("Type:"):
+                               self.nimTypes[lastsocket] = str(line.strip()[6:])
+                       elif line.strip().startswith("Name:"):
+                               self.nimNames[lastsocket] = str(line.strip()[6:])
+
                nimfile.close()
-               return self.nimType["empty/unknown"]
+               
+
+       def getNimType(self, slotID):
+               return self.nimType[self.nimTypes[slotID]]
 
        def getNimName(self, slotID):
-               #FIXME get it from /proc
-               return "Alps BSBE1"
+               return self.nimNames[slotID]
 
        def getNimSocketCount(self):
                #FIXME get it from /proc
@@ -200,6 +195,8 @@ class NimManager:
                
                self.nimCount = self.getNimSocketCount()
                
+               self.parseProc()
+               
                self.nimslots = [ ]
                x = 0
                while x < self.nimCount:
index 2772d87..6128890 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: tuxbox-enigma 0.0.1\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-11-18 06:29+0100\n"
+"POT-Creation-Date: 2005-11-21 16:28+0100\n"
 "PO-Revision-Date: 2005-11-17 20:53+0100\n"
 "Last-Translator: Automatically generated\n"
 "Language-Team: none\n"
@@ -226,7 +226,7 @@ msgstr "keins"
 msgid "unknown service"
 msgstr "unbekannter Service"
 
-#: ../lib/python/Screens/Ci.py:39
+#: ../lib/python/Screens/Ci.py:47
 msgid "waiting for CI..."
 msgstr ""
 
@@ -256,6 +256,10 @@ msgid "Hide error windows"
 msgstr "Fehlerfenster verstecken"
 
 #: ../data/
+msgid "help..."
+msgstr "Hilfe..."
+
+#: ../data/
 msgid "Service Scan"
 msgstr "Kanalsuche"