ParentalControl: Simplify some code
authorlittlesat <littlesat99@yahoo.com>
Wed, 8 Apr 2015 20:52:40 +0000 (22:52 +0200)
committerlittlesat <littlesat99@yahoo.com>
Wed, 8 Apr 2015 20:52:40 +0000 (22:52 +0200)
lib/python/Components/ParentalControl.py

index 27879e9..e6da41f 100644 (file)
@@ -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