fix more (no more allowed) global imports of parentalControl instance
authorghost <andreas.monzner@multimedia-labs.de>
Wed, 3 Nov 2010 16:40:34 +0000 (17:40 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Wed, 3 Nov 2010 16:40:34 +0000 (17:40 +0100)
refs bug #607

lib/python/Components/ParentalControlList.py
lib/python/Screens/ParentalControlSetup.py

index 797ea39..0e65257 100644 (file)
@@ -1,5 +1,5 @@
 from MenuList import MenuList
 from MenuList import MenuList
-from Components.ParentalControl import parentalControl, IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET
+from Components.ParentalControl import IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET
 from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
 
 from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
 from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
 
 from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
@@ -32,13 +32,14 @@ class ParentalControlList(MenuList):
                self.l.setItemHeight(32)
 
        def toggleSelectedLock(self):
                self.l.setItemHeight(32)
 
        def toggleSelectedLock(self):
+               from Components.ParentalControl import parentalControl
                print "self.l.getCurrentSelection():", self.l.getCurrentSelection()
                print "self.l.getCurrentSelectionIndex():", self.l.getCurrentSelectionIndex()
                curSel = self.l.getCurrentSelection()
                if curSel[0][2]:
                        parentalControl.unProtectService(self.l.getCurrentSelection()[0][0])
                else:
                print "self.l.getCurrentSelection():", self.l.getCurrentSelection()
                print "self.l.getCurrentSelectionIndex():", self.l.getCurrentSelectionIndex()
                curSel = self.l.getCurrentSelection()
                if curSel[0][2]:
                        parentalControl.unProtectService(self.l.getCurrentSelection()[0][0])
                else:
-                       parentalControl.protectService(self.l.getCurrentSelection()[0][0])      
+                       parentalControl.protectService(self.l.getCurrentSelection()[0][0])
                #Instead of just negating the locked- flag, now I call the getProtectionType every time...
                self.list[self.l.getCurrentSelectionIndex()] = ParentalControlEntryComponent(curSel[0][0], curSel[0][1], parentalControl.getProtectionType(curSel[0][0]))
                self.l.setList(self.list)
                #Instead of just negating the locked- flag, now I call the getProtectionType every time...
                self.list[self.l.getCurrentSelectionIndex()] = ParentalControlEntryComponent(curSel[0][0], curSel[0][1], parentalControl.getProtectionType(curSel[0][0]))
                self.l.setList(self.list)
index f174b58..284294f 100644 (file)
@@ -3,7 +3,7 @@ from Components.ConfigList import ConfigListScreen
 from Components.ActionMap import NumberActionMap
 from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, ConfigPIN
 from Components.ParentalControlList import ParentalControlEntryComponent, ParentalControlList 
 from Components.ActionMap import NumberActionMap
 from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, ConfigPIN
 from Components.ParentalControlList import ParentalControlEntryComponent, ParentalControlList 
-from Components.ParentalControl import parentalControl
+
 from Components.Sources.StaticText import StaticText
 from Screens.ChoiceBox import ChoiceBox
 from Screens.MessageBox import MessageBox
 from Components.Sources.StaticText import StaticText
 from Screens.ChoiceBox import ChoiceBox
 from Screens.MessageBox import MessageBox
@@ -119,6 +119,7 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen):
                elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
                        self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup PIN"))
                elif self["config"].l.getCurrentSelection() == self.reloadLists:
                elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
                        self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup PIN"))
                elif self["config"].l.getCurrentSelection() == self.reloadLists:
+                       from Components.ParentalControl import parentalControl
                        parentalControl.open()
                else:
                        ConfigListScreen.keyRight(self)
                        parentalControl.open()
                else:
                        ConfigListScreen.keyRight(self)
@@ -255,6 +256,7 @@ class ParentalControlEditor(Screen):
                self.session.openWithCallback(self.letterChosen, ChoiceBox, title=_("Show services beginning with"), list=mylist, keys = [], selection = sel)
 
        def letterChosen(self, result):
                self.session.openWithCallback(self.letterChosen, ChoiceBox, title=_("Show services beginning with"), list=mylist, keys = [], selection = sel)
 
        def letterChosen(self, result):
+               from Components.ParentalControl import parentalControl
                if result is not None:
                        print "result:", result
                        self.currentLetter = result[1]
                if result is not None:
                        print "result:", result
                        self.currentLetter = result[1]
@@ -284,6 +286,7 @@ class ParentalControlBouquetEditor(Screen):
                }, -1)
 
        def cancel(self):
                }, -1)
 
        def cancel(self):
+               from Components.ParentalControl import parentalControl
                parentalControl.save()
                self.close()
 
                parentalControl.save()
                self.close()
 
@@ -300,6 +303,7 @@ class ParentalControlBouquetEditor(Screen):
                        self.bouquetlist = list.getContent("CN", True)
        
        def selectBouquet(self):
                        self.bouquetlist = list.getContent("CN", True)
        
        def selectBouquet(self):
+               from Components.ParentalControl import parentalControl
                self.list = [ParentalControlEntryComponent(x[0], x[1], parentalControl.getProtectionType(x[0])) for x in self.bouquetlist]
                self.bouquetslist.setList(self.list)
 
                self.list = [ParentalControlEntryComponent(x[0], x[1], parentalControl.getProtectionType(x[0])) for x in self.bouquetlist]
                self.bouquetslist.setList(self.list)