From 052a79386510e7300ea09507faf52a668bd903ad Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 10 Oct 2006 13:56:56 +0000 Subject: [PATCH] use service compare strings instead of eServiceReferences in parental control --- lib/python/Components/ParentalControl.py | 7 +++---- lib/python/Screens/ParentalControlSetup.py | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/python/Components/ParentalControl.py b/lib/python/Components/ParentalControl.py index 97e9fad5..ac786fcd 100644 --- a/lib/python/Components/ParentalControl.py +++ b/lib/python/Components/ParentalControl.py @@ -92,16 +92,15 @@ class ParentalControl: print "unprotect" print "config.ParentalControl.type.value:", config.ParentalControl.type.value if config.ParentalControl.type.value == "whitelist": - if service.toCompareString() not in self.whitelist: + if service not in self.whitelist: self.addWhitelistService(service) else: # blacklist - if service.toCompareString() in self.blacklist: + if service in self.blacklist: self.deleteBlacklistService(service) print "whitelist:", self.whitelist print "blacklist:", self.blacklist - def getProtectionLevel(self, serviceref): - service = serviceref.toCompareString() + def getProtectionLevel(self, service): if (config.ParentalControl.type.value == "whitelist" and service not in self.whitelist) or (config.ParentalControl.type.value == "blacklist" and service in self.blacklist): if self.serviceLevel.has_key(service): return self.serviceLevel[service] diff --git a/lib/python/Screens/ParentalControlSetup.py b/lib/python/Screens/ParentalControlSetup.py index 77d592d8..a8fdcc5f 100644 --- a/lib/python/Screens/ParentalControlSetup.py +++ b/lib/python/Screens/ParentalControlSetup.py @@ -170,9 +170,9 @@ class ParentalControlEditor(Screen): list = serviceHandler.list(self.root) if list is not None: - services = list.getContent("CRN", True) #(servicecomparestring, eServiceRef, name) + services = list.getContent("CN", True) #(servicecomparestring, name) for s in services: - key = s[2].lower()[0] + key = s[1].lower()[0] if key < 'a' or key > 'z': key = '&' #key = str(key) @@ -201,7 +201,7 @@ class ParentalControlEditor(Screen): self.currentLetter = result[1] self.list = [] for x in self.servicesList[result[1]]: - self.list.append(ParentalControlEntryComponent(x[1], x[2], parentalControl.getProtectionLevel(x[1]) != -1)) + self.list.append(ParentalControlEntryComponent(x[0], x[1], parentalControl.getProtectionLevel(x[0]) != -1)) self.servicelist.setList(self.list) class ParentalControlChangePin(Screen, ConfigListScreen, ProtectedScreen): -- 2.30.2