diff options
| author | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-10-08 01:13:51 +0000 |
|---|---|---|
| committer | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-10-08 01:13:51 +0000 |
| commit | bb6146d86041cf7374d6f3927cdc2c829e00afc7 (patch) | |
| tree | dfab7c05ea777203bbeb30848d6dfc74004e7d43 /lib/python/Components | |
| parent | d9b059092190e52bbd8c93bc2695049bbe8a9ea8 (diff) | |
| download | enigma2-bb6146d86041cf7374d6f3927cdc2c829e00afc7.tar.gz enigma2-bb6146d86041cf7374d6f3927cdc2c829e00afc7.zip | |
add satlist file-io
add special defaultValue handling for satlist
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/config.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index bd5656c9..72bc7beb 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -249,6 +249,23 @@ class ConfigSubsection: pass class configElement: + + def getIndexbyEntry(self, data): + cnt = 0; + tcnt = -1; #for defaultval + for x in self.vals: + if int(x[1]) == int(data): + print "return entry" + return cnt + if int(x[1]) == int(self.defaultValue): + tcnt = cnt + cnt += 1 + if tcnt != -1: + print "return default" + return tcnt + print "return fix" + return 0 + def datafromFile(self, control, data): if control == ConfigSlider: return int(data); @@ -260,6 +277,8 @@ class configElement: for x in part: list.append(int(x)) return list + elif control == configSatlist: + return self.getIndexbyEntry(data) else: return "" @@ -277,6 +296,9 @@ class configElement: # value += self.vals[0] # value += str(i) return value + elif control == configSatlist: + print "value is " + str(self.value) + return str(self.vals[self.value][1]); else: return "" @@ -286,9 +308,16 @@ class configElement: except: value = "" + print "get value " + str(value) + if value == "": print "value not found - using default" - self.value = self.defaultValue + + if self.controlType == configSatlist: + self.value = self.getIndexbyEntry(self.defaultValue) + else: + self.value = self.defaultValue + self.save() #add missing value to dict else: self.value = value |
