aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-10-07 12:42:24 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-10-07 12:42:24 +0000
commit2764d1bc2a6c99003d0039804acadb82446554d1 (patch)
treed89a55724ac8c491fdce32b9c82347dc622e9783 /lib/python
parent1716a08994f7be55023e37b909b83112aa8058cd (diff)
downloadenigma2-2764d1bc2a6c99003d0039804acadb82446554d1.tar.gz
enigma2-2764d1bc2a6c99003d0039804acadb82446554d1.zip
allow empty ConfigSelection, value will be '' then. remove KEY_TIMEOUT from ConfigSelection, we don't need it there. Fix empty satlist. orbitial_position will be None if satlist is empty.
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/ConfigList.py2
-rw-r--r--lib/python/Components/config.py12
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/python/Components/ConfigList.py b/lib/python/Components/ConfigList.py
index 883a1ea4..dc10045c 100644
--- a/lib/python/Components/ConfigList.py
+++ b/lib/python/Components/ConfigList.py
@@ -100,7 +100,7 @@ class ConfigListScreen:
"8": self.keyNumberGlobal,
"9": self.keyNumberGlobal,
"0": self.keyNumberGlobal
- }, 5)
+ }, -1) # to prevent left/right overriding the listbox
self["config"] = ConfigList(list, session = session)
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index 4da004e1..10f112c6 100644
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -125,7 +125,10 @@ class ConfigSelection(ConfigElement):
else:
assert False, "ConfigSelection choices must be dict or list!"
- assert len(self.choices), "you can't have an empty configselection"
+ #assert len(self.choices), "you can't have an empty configselection"
+ if len(self.choices) == 0:
+ self.choices = [""]
+ self.description[""] = ""
if default is None:
default = self.choices[0]
@@ -165,9 +168,6 @@ class ConfigSelection(ConfigElement):
self.value = self.choices[(i + nchoices - 1) % nchoices]
elif key == KEY_RIGHT:
self.value = self.choices[(i + 1) % nchoices]
- elif key == KEY_TIMEOUT:
- self.timeout()
- return
def getMulti(self, selected):
return ("text", self.description[self.value])
@@ -551,11 +551,11 @@ class ConfigSatlist(ConfigSelection):
def __init__(self, list, default = None):
if default is not None:
default = str(default)
- if list == [ ]:
- list = [0, "N/A"]
ConfigSelection.__init__(self, choices = [(str(orbpos), desc) for (orbpos, desc) in list], default = default)
def getOrbitalPosition(self):
+ if self.value == "":
+ return None
return int(self.value)
orbital_position = property(getOrbitalPosition)