aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2010-05-07 12:49:48 +0200
committerghost <andreas.monzner@multimedia-labs.de>2010-05-07 12:50:30 +0200
commit0f6a9da7c79334369e536649a46e05e56ec09eed (patch)
treeff1e2e86ae0ee9d092b25f4ac1745c2a2b1ec6c3
parenta145e380dcf5aac25d54bd634f92e9312a791f84 (diff)
downloadenigma2-0f6a9da7c79334369e536649a46e05e56ec09eed.tar.gz
enigma2-0f6a9da7c79334369e536649a46e05e56ec09eed.zip
mytest.py: load bouquets before parental control init and remove strange hack in parental control
this fixes bug #532
-rw-r--r--lib/python/Components/ParentalControl.py11
-rwxr-xr-xmytest.py6
2 files changed, 5 insertions, 12 deletions
diff --git a/lib/python/Components/ParentalControl.py b/lib/python/Components/ParentalControl.py
index 9942bca7..63b5ccfb 100644
--- a/lib/python/Components/ParentalControl.py
+++ b/lib/python/Components/ParentalControl.py
@@ -55,11 +55,10 @@ def InitParentalControl():
class ParentalControl:
def __init__(self):
#Do not call open on init, because bouquets are not ready at that moment
-# self.open()
+ self.open()
self.serviceLevel = {}
#Instead: Use Flags to see, if we already initialized config and called open
self.configInitialized = False
- self.filesOpened = False
#This is the timer that is used to see, if the time for caching the pin is over
#Of course we could also work without a timer and compare the times every
#time we call isServicePlayable. But this might probably slow down zapping,
@@ -89,9 +88,6 @@ class ParentalControl:
def isServicePlayable(self, ref, callback):
if not config.ParentalControl.configured.value or not config.ParentalControl.servicepinactive.value:
return True
- #Check if we already read the whitelists and blacklists. If not: call open
- if self.filesOpened == False:
- self.open()
#Check if configuration has already been read or if the significant values have changed.
#If true: read the configuration
if self.configInitialized == False or self.storeServicePin != config.ParentalControl.storeservicepin.value or self.storeServicePinCancel != config.ParentalControl.storeservicepincancel.value:
@@ -153,8 +149,6 @@ class ParentalControl:
def getProtectionType(self, service):
#New method used in ParentalControlList: This method does not only return
#if a service is protected or not, it also returns, why (whitelist or blacklist, service or bouquet)
- if self.filesOpened == False:
- self.open()
sImage = ""
if (config.ParentalControl.type.value == LIST_WHITELIST):
if self.whitelist.has_key(service):
@@ -319,14 +313,11 @@ class ParentalControl:
def save(self):
# we need to open the files in case we havent's read them yet
- if not self.filesOpened:
- self.open()
self.saveListToFile(LIST_BLACKLIST)
self.saveListToFile(LIST_WHITELIST)
def open(self):
self.openListFromFile(LIST_BLACKLIST)
self.openListFromFile(LIST_WHITELIST)
- self.filesOpened = True
parentalControl = ParentalControl()
diff --git a/mytest.py b/mytest.py
index c748538a..0b9be523 100755
--- a/mytest.py
+++ b/mytest.py
@@ -30,6 +30,9 @@ from Screens.SimpleSummary import SimpleSummary
from sys import stdout, exc_info
+profile("Bouquets")
+eDVBDB.getInstance().reloadBouquets()
+
profile("ParentalControl")
from Components.ParentalControl import InitParentalControl
InitParentalControl()
@@ -45,8 +48,7 @@ from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS,
from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, NoSave
InitFallbackFiles()
-profile("ReloadProfiles")
-eDVBDB.getInstance().reloadBouquets()
+profile("config.misc")
config.misc.radiopic = ConfigText(default = resolveFilename(SCOPE_CURRENT_SKIN, "radio.mvi"))
config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False)