don't crash when having unknown fec/pol values (possibly due to broken satellites...
[enigma2.git] / lib / python / Plugins / SystemPlugins / Satfinder / plugin.py
index 3c86734a1ffd637ebd0773c8f27bde630917107c..fc1d3ab3c353cfa26955280117313f95c7c3de09 100644 (file)
@@ -41,7 +41,7 @@ class Tuner:
 class Satfinder(ScanSetup):
        skin = """
                <screen position="90,100" size="520,400" title="Tune">
-                       <widget name="config" position="20,10" size="460,240" scrollbarMode="showOnDemand" />
+                       <widget name="config" position="20,10" size="460,210" scrollbarMode="showOnDemand" />
                        <widget name="introduction" position="20,360" zPosition="-10" size="350,30" font="Regular;23" />
                        <eLabel text="dB:" position="23,230" size="60,22" font="Regular;21" />
                        <eLabel text="SNR:" position="23,255" size="60,22" font="Regular;21" />
@@ -189,6 +189,8 @@ class Satfinder(ScanSetup):
                                        pol = "CL"
                                elif x[3] == 3:
                                        pol = "CR"
+                               else:
+                                       pol = "??"
                                if x[4] == 0:
                                        fec = "FEC_AUTO"
                                elif x[4] == 1:
@@ -205,6 +207,8 @@ class Satfinder(ScanSetup):
                                        fec = "FEC_8_9"
                                elif x[4] == 6:
                                        fec = "FEC_None"
+                               else:
+                                       fec = "FEC_Unknown"
                                list.append(str(x[1]) + "," + str(x[2]) + "," + pol + "," + fec)
                        self.tuning_transponder = ConfigSelection(choices = list)
                        self.tuning_transponder.addNotifier(self.retune, initial_call = False)
@@ -272,12 +276,12 @@ def SatfinderMain(session, **kwargs):
 
 def SatfinderStart(menuid, **kwargs):
        if menuid == "scan":
-               return [(_("Satfinder"), SatfinderMain)]
+               return [(_("Satfinder"), SatfinderMain, "satfinder", None)]
        else:
                return []
 
 def Plugins(**kwargs):
        if (nimmanager.hasNimType("DVB-S")):
-               return PluginDescriptor(name=_("Satfinder"), description="Helps setting up your dish", where = PluginDescriptor.WHERE_SETUP, fnc=SatfinderStart)
+               return PluginDescriptor(name=_("Satfinder"), description="Helps setting up your dish", where = PluginDescriptor.WHERE_MENU, fnc=SatfinderStart)
        else:
                return []