From e128ab84e720068a36530a0dab1426f893697247 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Thu, 19 Oct 2006 19:59:05 +0000 Subject: [PATCH] fix python part of ePythonConfig::getConfigQuery... so now default ac3 and 5V on Terrestrial Tuner are working again --- lib/dvb/frontend.cpp | 4 ++-- lib/dvb_ci/dvbci.cpp | 2 +- lib/python/Components/config.py | 17 ++++++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index cfd2610d..3905a187 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -1782,10 +1782,10 @@ RESULT eDVBFrontend::tune(const iDVBFrontendParameters &where) std::string enable_5V; char configStr[255]; - snprintf(configStr, 255, "config.Nim%c.terrestrial_5V", 'A'+m_fe); + snprintf(configStr, 255, "config.Nims.%d.terrestrial_5V", m_fe); m_sec_sequence.push_back( eSecCommand(eSecCommand::START_TUNE_TIMEOUT) ); ePythonConfigQuery::getConfigValue(configStr, enable_5V); - if (enable_5V == "on") + if (enable_5V == "True") m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) ); else m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltageOff) ); diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index d95f6832..b074342e 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -221,7 +221,7 @@ void eDVBCIInterfaces::ciRemoved(eDVBCISlot *slot) static bool canDescrambleMultipleServices(int slotid) { char configStr[255]; - snprintf(configStr, 255, "config.ci%d.canDescrambleMultipleServices", slotid); + snprintf(configStr, 255, "config.ci.%d.canDescrambleMultipleServices", slotid); std::string str; ePythonConfigQuery::getConfigValue(configStr, str); if ( str == "auto" ) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index b7b3baa8..0fd6e732 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -832,8 +832,23 @@ class ConfigFile: config.save() config.saveToFile(self.CONFIG_FILE) + def __resolveValue(self, pickles, cmap): + if cmap.has_key(pickles[0]): + if len(pickles) > 1: + return self.__resolveValue(pickles[1:], cmap[pickles[0]].content.items) + else: + return str(cmap[pickles[0]].value) + return None + def getResolvedKey(self, key): - return None # FIXME + names = key.split('.') + if len(names) > 1: + if names[0] == "config": + ret=self.__resolveValue(names[1:], config.content.items) + if ret and len(ret): + return ret + print "getResolvedKey", key, "failed !! (Typo??)" + return "" def NoSave(element): element.disableSave() -- 2.30.2