From 467a11948a381d39665fb0148f9892de6ae0d3ba Mon Sep 17 00:00:00 2001 From: littlesat Date: Wed, 8 Apr 2015 22:52:40 +0200 Subject: [PATCH] ParentalControl: Simplify some code --- lib/python/Components/ParentalControl.py | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/python/Components/ParentalControl.py b/lib/python/Components/ParentalControl.py index 27879e9..e6da41f 100644 --- a/lib/python/Components/ParentalControl.py +++ b/lib/python/Components/ParentalControl.py @@ -177,18 +177,16 @@ class ParentalControl: self.sessionPinTimer.startLongTimer(self.pinIntervalSeconds) def servicePinEntered(self, service, result): - if result is not None and result: + if result: self.setSessionPinCached() self.hideBlacklist() self.callback(ref = service) - else: - #This is the new function of caching cancelling of service pin - if result is not None: - messageText = _("The pin code you entered is wrong.") - if self.session: - self.session.open(MessageBox, messageText, MessageBox.TYPE_INFO, timeout=3) - else: - AddPopup(messageText, MessageBox.TYPE_ERROR, timeout = 3) + elif result == False: + messageText = _("The pin code you entered is wrong.") + if self.session: + self.session.open(MessageBox, messageText, MessageBox.TYPE_INFO, timeout=3) + else: + AddPopup(messageText, MessageBox.TYPE_ERROR, timeout = 3) def saveListToFile(self,sWhichList,vList): #Replaces saveWhiteList and saveBlackList: @@ -274,4 +272,4 @@ class ParentalControl: for ref in self.blacklist: if TYPE_BOUQUET not in ref: eDVBDB.getInstance().removeFlag(eServiceReference(ref), 2) - refreshServiceList() + refreshServiceList() \ No newline at end of file -- 1.7.1