got rid of custom configselection since the core one now allows non-string choices too
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Fri, 23 Jan 2009 13:16:43 +0000 (13:16 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Fri, 23 Jan 2009 13:16:43 +0000 (13:16 +0000)
epgrefresh/CONTROL/control
epgrefresh/src/EPGRefreshChannelEditor.py

index 7fe6ca8..8e420e9 100644 (file)
@@ -1,10 +1,10 @@
 Package: enigma2-plugin-extensions-epgrefresh
-Version: 0.1.0-20080603-r0
+Version: 0.2.0-20090123-r0
 Description: Plugin to refresh EPG Data when Reciever is inactive
 Architecture: mipsel
 Section: extra
 Priority: optional
 Maintainer: Moritz Venn <moritz.venn@freaque.net>
 Homepage: http://www.ritzmo.de
-Depends: enigma2(>=2.5cvs20080416)
+Depends: enigma2(>=2.6git20090120)
 Source: http://enigma2-plugins.schwerkraft.elitedvb.net/
index d51a3e6..4c017bd 100644 (file)
@@ -22,37 +22,6 @@ from EPGRefreshService import EPGRefreshService
 # Show ServiceName instead of ServiceReference
 from ServiceReference import ServiceReference
 
-# This is a modified ConfigSelection which does not require the
-# choices to be strings...
-class ConfigDummy(ConfigSelection):
-       def setChoices(self, choices, default = None):
-               self.choices = [] 
-               self.description = {} 
-        
-               if isinstance(choices, list):
-                       for x in choices:
-                               if isinstance(x, tuple):
-                                       self.choices.append(x[0])
-                                       self.description[x[0]] = x[1] 
-                               else:
-                                       self.choices.append(x)
-                                       self.description[x] = x
-               else:
-                       assert False, "ConfigDummy choices must be a list!"
-        
-               if len(self.choices) == 0:
-                       self.choices = [""] 
-                       self.description[""] = "" 
-
-               if default is None:
-                       default = self.choices[0]
-
-               assert default in self.choices, "default must be in choice list, but " + repr(default) + " is not!"
-               self.default = default
-
-               if self.value == None or not self.value in self.choices:
-                       self.value = default
-
 class SimpleBouquetSelection(SimpleChannelSelection):
        def __init__(self, session, title):
                SimpleChannelSelection.__init__(self, session, title)
@@ -95,7 +64,7 @@ class EPGRefreshServiceEditor(Screen, ConfigListScreen):
                        services[1][:]
                )
 
-               self.typeSelection = ConfigDummy(choices = [("channels", _("Channels")), ("bouquets", _("Bouquets"))])
+               self.typeSelection = ConfigSelection(choices = [("channels", _("Channels")), ("bouquets", _("Bouquets"))])
                self.typeSelection.addNotifier(self.refresh, initial_call = False)
 
                self.reloadList()
@@ -153,7 +122,7 @@ class EPGRefreshServiceEditor(Screen, ConfigListScreen):
                        self.idx = 1
 
                self.list.extend([
-                       getConfigListEntry(_("Refreshing"), ConfigDummy(choices = [(x, ServiceReference(x.sref).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', ''))]))
+                       getConfigListEntry(_("Refreshing"), ConfigSelection(choices = [(x, ServiceReference(x.sref).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', ''))]))
                                for x in self.services[self.idx]
                ])
 
@@ -205,7 +174,7 @@ class EPGRefreshServiceEditor(Screen, ConfigListScreen):
                        list = self["config"].getList()
                        list.append(getConfigListEntry(
                                _("Refreshing"),
-                               ConfigDummy(choices = [(
+                               ConfigSelection(choices = [(
                                        EPGRefreshService(args[0].toString(), None),
                                        ServiceReference(args[0]).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '')
                                )])