X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/38b8a24b2034c387aa0762eb8a3d96b786fd581b..2b80914bdd9aada1797f450bbb9089f6d9bb5740:/lib/python/Screens/ServiceInfo.py diff --git a/lib/python/Screens/ServiceInfo.py b/lib/python/Screens/ServiceInfo.py index 4606f883..df8af4b4 100644 --- a/lib/python/Screens/ServiceInfo.py +++ b/lib/python/Screens/ServiceInfo.py @@ -5,6 +5,7 @@ from Components.ActionMap import ActionMap from Components.Label import Label from ServiceReference import ServiceReference from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation, eServiceCenter +from Tools.Transponder import ConvertToHumanReadable RT_HALIGN_LEFT = 0 @@ -24,7 +25,7 @@ def ServiceInfoListEntry(a, b, valueType=TYPE_TEXT, param=4): res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 200, 30, 0, RT_HALIGN_LEFT, "")) res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 200, 25, 0, RT_HALIGN_LEFT, a)) print "b:", b - if type(b) is not str: + if not isinstance(b, str): if valueType == TYPE_VALUE_HEX: b = ("0x%0" + str(param) + "x") % to_unsigned(b) elif valueType == TYPE_VALUE_DEC: @@ -131,27 +132,28 @@ class ServiceInfo(Screen): self.fillList(Labels) else: if self.transponder_info: - conv = { "type" : _("Transponder Type"), + tp_info = ConvertToHumanReadable(self.transponder_info) + conv = { "tuner_type" : _("Transponder Type"), "system" : _("System"), "modulation" : _("Modulation"), - "orbital position" : _("Orbital Position"), + "orbital_position" : _("Orbital Position"), "frequency" : _("Frequency"), - "symbolrate" : _("Symbolrate"), + "symbol_rate" : _("Symbolrate"), "bandwidth" : _("Bandwidth"), "polarization" : _("Polarization"), "inversion" : _("Inversion"), "pilot" : _("Pilot"), - "roll off" : _("Rolloff"), - "fec inner" : _("FEC"), - "code rate lp" : _("Coderate LP"), - "code rate hp" : _("Coderate HP"), + "rolloff" : _("Rolloff"), + "fec_inner" : _("FEC"), + "code_rate_lp" : _("Coderate LP"), + "code_rate_hp" : _("Coderate HP"), "constellation" : _("Constellation"), - "transmission mode": _("Transmission Mode"), - "guard interval" : _("Guard Interval"), - "hierarchy" : _("Hierarchy Information") } + "transmission_mode": _("Transmission Mode"), + "guard_interval" : _("Guard Interval"), + "hierarchy_information": _("Hierarchy Information") } Labels = [ ] - for i in self.transponder_info.keys(): - Labels.append( (conv[i], self.transponder_info[i], TYPE_TEXT) ) + for i in tp_info.keys(): + Labels.append( (conv[i], tp_info[i], TYPE_VALUE_DEC) ) self.fillList(Labels) def pids(self): @@ -180,9 +182,10 @@ class ServiceInfo(Screen): if self.type == TYPE_SERVICE_INFO: self.showFrontendData(False) - def getFEData(self, frontendData): - if frontendData and len(frontendData): - if frontendData["tuner_type"] == "DVB-S": + def getFEData(self, frontendDataOrg): + if frontendDataOrg and len(frontendDataOrg): + frontendData = ConvertToHumanReadable(frontendDataOrg) + if frontendDataOrg["tuner_type"] == "DVB-S": return (("NIM", ['A', 'B', 'C', 'D'][frontendData["tuner_number"]], TYPE_TEXT), ("Type", frontendData["system"], TYPE_TEXT), ("Modulation", frontendData["modulation"], TYPE_TEXT), @@ -194,7 +197,7 @@ class ServiceInfo(Screen): ("FEC inner", frontendData["fec_inner"], TYPE_TEXT), ("Pilot", frontendData.get("pilot", None), TYPE_TEXT), ("Rolloff", frontendData.get("rolloff", None), TYPE_TEXT)) - elif frontendData["tuner_type"] == "DVB-C": + elif frontendDataOrg["tuner_type"] == "DVB-C": return (("NIM", ['A', 'B', 'C', 'D'][frontendData["tuner_number"]], TYPE_TEXT), ("Type", frontendData["tuner_type"], TYPE_TEXT), ("Frequency", frontendData["frequency"], TYPE_VALUE_DEC), @@ -202,7 +205,7 @@ class ServiceInfo(Screen): ("Modulation", frontendData["modulation"], TYPE_TEXT), ("Inversion", frontendData["inversion"], TYPE_TEXT), ("FEC inner", frontendData["fec_inner"], TYPE_TEXT)) - elif frontendData["tuner_type"] == "DVB-T": + elif frontendDataOrg["tuner_type"] == "DVB-T": return (("NIM", ['A', 'B', 'C', 'D'][frontendData["tuner_number"]], TYPE_TEXT), ("Type", frontendData["tuner_type"], TYPE_TEXT), ("Frequency", frontendData["frequency"], TYPE_VALUE_DEC),