dont crash when the satellites.xml does not exist or is empty
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 5 Jun 2008 09:19:02 +0000 (09:19 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 5 Jun 2008 09:19:02 +0000 (09:19 +0000)
lib/python/Components/NimManager.py
lib/python/Screens/Satconfig.py

index 9662a10..4865989 100644 (file)
@@ -38,6 +38,8 @@ class SecConfigure:
                self.configuredSatellites.add(orbpos)
 
        def addLNBSimple(self, sec, slotid, diseqcmode, toneburstmode = diseqcParam.NO, diseqcpos = diseqcParam.SENDNO, orbpos = 0, longitude = 0, latitude = 0, loDirection = 0, laDirection = 0, turningSpeed = rotorParam.FAST, useInputPower=True, inputPowerDelta=50):
+               if orbpos is None:
+                       return
                #simple defaults
                sec.addLNB()
                tunermask = 1 << slotid
index 5415ae0..398a13e 100644 (file)
@@ -64,6 +64,7 @@ class NimSetup(Screen, ConfigListScreen):
                self.turnFastEpochEnd = None
                self.uncommittedDiseqcCommand = None
                self.cableScanType = None
+               self.have_advanced = False
 
                if self.nim.isCompatible("DVB-S"):
                        self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
@@ -84,11 +85,12 @@ class NimSetup(Screen, ConfigListScreen):
                                self.list.append(self.advancedSatsEntry)
                                cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
                                satlist = self.nimConfig.advanced.sat.keys()
-                               if cur_orb_pos not in satlist:
-                                       cur_orb_pos = satlist[0]
-                               currSat = self.nimConfig.advanced.sat[cur_orb_pos]
-                               self.fillListWithAdvancedSatEntrys(currSat)
-                       self.have_advanced = True
+                               if cur_orb_pos is not None:
+                                       if cur_orb_pos not in satlist:
+                                               cur_orb_pos = satlist[0]
+                                       currSat = self.nimConfig.advanced.sat[cur_orb_pos]
+                                       self.fillListWithAdvancedSatEntrys(currSat)
+                               self.have_advanced = True
                elif self.nim.isCompatible("DVB-C"):
                        self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
                        self.list.append(self.configMode)