add some get methods for python
[enigma2.git] / lib / python / Screens / ScanSetup.py
index 71096a52d5015e0a375591b10b0a043fca6727e2..03374c501d0050e601ce4b5fd286da2079560a02 100644 (file)
@@ -170,4 +170,53 @@ class ScanSetup(Screen):
     def keyCancel(self):
         for x in self["config"].list:
             x[1].cancel()
-        self.close()
\ No newline at end of file
+        self.close()
+
+class ScanSimple(Screen):
+
+       def keyOK(self):
+               print "start scan for sats:"
+               for x in self.list:
+                       if x[1].parent.value == 0:
+                               print "   " + str(x[1].parent.configPath)
+               
+       def keyCancel(self):
+               self.close()
+
+       def keyLeft(self):
+               self["config"].handleKey(config.key["prevElement"])
+
+       def keyRight(self):
+               self["config"].handleKey(config.key["nextElement"])
+
+       def Satexists(self, tlist, pos):
+               for x in tlist:
+                       if x == pos:
+                               return 1
+               return 0
+
+       def __init__(self, session):
+               Screen.__init__(self, session)
+
+               self["actions"] = ActionMap(["SetupActions"],
+               {
+                       "ok": self.keyOK,
+                       "cancel": self.keyCancel,
+                       "left": self.keyLeft,
+                       "right": self.keyRight,
+               }, -1)
+                
+               self.list = []
+               tlist = []
+               
+               SatList = nimmanager.getConfiguredSats()
+
+               for x in SatList:
+                       if self.Satexists(tlist, x) == 0:
+                               tlist.append(x)
+                               sat = configElement_nonSave(x, configSelection, 0, ("Enable", "Disable"))
+                               self.list.append(getConfigListEntry(nimmanager.getSatDescription(x), sat))
+
+               self["config"] = ConfigList(self.list)
+               self["header"] = Label("Automatic Scan")
+               self["footer"] = Label("Press OK to scan")