class PermanentPinEntry(ConfigListScreen, Screen): def __init__(self, session, pin, pin_slot): Screen.__init__(self, session) self.skinName = ["ParentalControlChangePin", "Setup"] self.onChangedEntry = [] self.slot = pin_slot self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=0, censor="*") self.pin2 = ConfigPIN(default=0, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("Enter PIN"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Re-enter PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list, fullUI=True) self.setTitle(_("Enter PIN Code")) def valueChanged(self, pin, value): if pin == 1: self["config"].setCurrentIndex(1) elif pin == 2: self.keyOK() def keySave(self): if self.pin1.value == self.pin2.value: self.pin.value = self.pin1.value self.pin.save() self.session.openWithCallback(self.close, MessageBox, _("The PIN code has been saved successfully."), MessageBox.TYPE_INFO) else: self.session.open(MessageBox, _("The PIN codes you entered are different."), MessageBox.TYPE_ERROR) def keyCancel(self): self.close(None)
def __init__(self, session, pin, pinname): Screen.__init__(self, session) # for the skin: first try ParentalControlChangePin, then Setup, this allows individual skinning self.skinName = ["ParentalControlChangePin", "Setup"] self.setup_title = _("Change pin code") self.onChangedEntry = [] self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=1111, censor="*") self.pin2 = ConfigPIN(default=1112, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New PIN"), NoSave(self.pin1))) self.list.append( getConfigListEntry(_("Reenter new PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) # print "old pin:", pin #if pin.value != "aaaa": #self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code"))) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap( [ "DirectionActions", "ColorActions", "OkCancelActions", "MenuActions" ], { "cancel": self.keyCancel, "red": self.keyCancel, "save": self.keyOK, "menu": self.closeRecursive, }, -1) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, pin, title=_("Change password")): Screen.__init__(self, session) self.skinName = ["PasswordSetup", "Setup"] self.setup_title = title self.onChangedEntry = [] self.pin = pin self.list = [] self.pass1 = ConfigPIN(default=1111, censor="*") self.pass1.addEndNotifier(boundFunction(self.passChanged, 1)) self.pass2 = ConfigPIN(default=1112, censor="*") self.pass2.addEndNotifier(boundFunction(self.passChanged, 2)) self.list.append( getConfigListEntry(_("Enter new password"), NoSave(self.pass1))) self.list.append( getConfigListEntry(_("Reenter new password"), NoSave(self.pass2))) ConfigListScreen.__init__(self, self.list) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self["actions"] = NumberActionMap( ["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, "red": self.cancel, "save": self.keyOK, "green": self.keyOK, }, -1) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, pin, pin_slot): Screen.__init__(self, session) self.skinName = ["ParentalControlChangePin", "Setup"] self.setup_title = _("Enter pin code") self.onChangedEntry = [] self.slot = pin_slot self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=0, censor="*") self.pin2 = ConfigPIN(default=0, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("Enter PIN"), NoSave(self.pin1))) self.list.append( getConfigListEntry(_("Reenter PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) self["actions"] = NumberActionMap( ["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, "red": self.cancel, "save": self.keyOK, }, -1) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, pin, pinname): Screen.__init__(self, session) self.skinName = ['ParentalControlChangePin', 'Setup'] self.setup_title = _('Change pin code') self.onChangedEntry = [] self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=1111, censor='*') self.pin2 = ConfigPIN(default=1112, censor='*') self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_('New PIN'), NoSave(self.pin1))) self.list.append( getConfigListEntry(_('Re-enter new PIN'), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) ProtectedScreen.__init__(self) self['actions'] = NumberActionMap( [ 'DirectionActions', 'ColorActions', 'OkCancelActions', 'MenuActions' ], { 'cancel': self.keyCancel, 'red': self.keyCancel, 'save': self.keyOK, 'menu': self.closeRecursive }, -1) self['key_red'] = StaticText(_('Cancel')) self['key_green'] = StaticText(_('OK')) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, pin, pinname): Screen.__init__(self, session) # for the skin: first try ParentalControlChangePin, then Setup, this allows individual skinning self.skinName = ["ParentalControlChangePin", "Setup" ] self.setup_title = _("Change pin code") self.onChangedEntry = [ ] self.pin = pin self.list = [] self.pin1 = ConfigPIN(default = 1111, censor = "*") self.pin2 = ConfigPIN(default = 1112, censor = "*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New PIN"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Re-enter new PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions", "MenuActions"], { "cancel": self.keyCancel, "red": self.keyCancel, "save": self.keyOK, "menu": self.closeRecursive, }, -1) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, pin, pinname): Screen.__init__(self, session) # for the skin: first try ParentalControlChangePin, then Setup, this allows individual skinning self.skinName = ["ParentalControlChangePin", "Setup"] self.setTitle(_("Change pin code")) self.onChangedEntry = [] self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=1111, censor="*") self.pin2 = ConfigPIN(default=1112, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New PIN"), NoSave(self.pin1))) self.list.append( getConfigListEntry(_("Re-enter new PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap( [ "DirectionActions", "ColorActions", "OkCancelActions", "MenuActions" ], { "cancel": self.keyCancel, "red": self.keyCancel, "save": self.keyOK, "menu": self.closeRecursive, }, -1) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK"))
def __init__(self, session, pin, pinname): Screen.__init__(self, session) # for the skin: first try ParentalControlChangePin, then Setup, this allows individual skinning self.skinName = ["ParentalControlChangePin", "Setup"] self.setup_title = _("Change pin code") self.onChangedEntry = [] self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=1111, censor="*") self.pin2 = ConfigPIN(default=1112, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New PIN"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Reenter new PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) # print "old pin:", pin # if pin.value != "aaaa": # self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code"))) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap( ["DirectionActions", "ColorActions", "OkCancelActions"], {"cancel": self.cancel, "red": self.cancel, "save": self.keyOK}, -1, ) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, pin, pin_slot): Screen.__init__(self, session) self.skinName = ["ParentalControlChangePin", "Setup" ] self.setup_title = _("Enter pin code") self.onChangedEntry = [ ] self.slot = pin_slot self.pin = pin self.list = [] self.pin1 = ConfigPIN(default = 0, censor = "*") self.pin2 = ConfigPIN(default = 0, censor = "*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("Enter PIN"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Reenter PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, "red": self.cancel, "save": self.keyOK, }, -1) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self.onLayoutFinish.append(self.layoutFinished)
def InitParentalControl(): global parentalControl parentalControl = ParentalControl() config.ParentalControl = ConfigSubsection() config.ParentalControl.configured = ConfigYesNo(default = False) config.ParentalControl.mode = ConfigSelection(default = "simple", choices = [("simple", _("simple")), ("complex", _("complex"))]) config.ParentalControl.storeservicepin = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("5 minutes")), ("30", _("30 minutes")), ("60", _("60 minutes")), ("standby", _("until standby/restart"))]) config.ParentalControl.storeservicepincancel = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("5 minutes")), ("30", _("30 minutes")), ("60", _("60 minutes")), ("standby", _("until standby/restart"))]) config.ParentalControl.servicepinactive = ConfigYesNo(default = False) config.ParentalControl.setuppinactive = ConfigYesNo(default = False) config.ParentalControl.type = ConfigSelection(default = "blacklist", choices = [(LIST_WHITELIST, _("whitelist")), (LIST_BLACKLIST, _("blacklist"))]) config.ParentalControl.setuppin = ConfigPIN(default = -1) config.ParentalControl.retries = ConfigSubsection() config.ParentalControl.retries.setuppin = ConfigSubsection() config.ParentalControl.retries.setuppin.tries = ConfigInteger(default = 3) config.ParentalControl.retries.setuppin.time = ConfigInteger(default = 3) config.ParentalControl.retries.servicepin = ConfigSubsection() config.ParentalControl.retries.servicepin.tries = ConfigInteger(default = 3) config.ParentalControl.retries.servicepin.time = ConfigInteger(default = 3) # config.ParentalControl.configured = configElement("config.ParentalControl.configured", configSelection, 1, (("yes", _("yes")), ("no", _("no")))) #config.ParentalControl.mode = configElement("config.ParentalControl.mode", configSelection, 0, (("simple", _("simple")), ("complex", _("complex")))) #config.ParentalControl.storeservicepin = configElement("config.ParentalControl.storeservicepin", configSelection, 0, (("never", _("never")), ("5_minutes", _("5 minutes")), ("30_minutes", _("30 minutes")), ("60_minutes", _("60 minutes")), ("restart", _("until restart")))) #config.ParentalControl.servicepinactive = configElement("config.ParentalControl.servicepinactive", configSelection, 1, (("yes", _("yes")), ("no", _("no")))) #config.ParentalControl.setuppinactive = configElement("config.ParentalControl.setuppinactive", configSelection, 1, (("yes", _("yes")), ("no", _("no")))) #config.ParentalControl.type = configElement("config.ParentalControl.type", configSelection, 0, (("whitelist", _("whitelist")), ("blacklist", _("blacklist")))) #config.ParentalControl.setuppin = configElement("config.ParentalControl.setuppin", configSequence, "0000", configSequenceArg().get("PINCODE", (4, ""))) config.ParentalControl.servicepin = ConfigSubList() for i in (0, 1, 2): config.ParentalControl.servicepin.append(ConfigPIN(default = -1))
class ParentalControlChangePin(Screen, ConfigListScreen, ProtectedScreen): def __init__(self, session, pin, pinname): Screen.__init__(self, session) self.pin = pin self.list = [] self.pin1 = ConfigPIN(default = 1111, censor = "*") self.pin2 = ConfigPIN(default = 1112, censor = "*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New pin"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Reenter new pin"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) # print "old pin:", pin #if pin.value != "aaaa": #self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code"))) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, }, -1) def valueChanged(self, pin, value): if pin == 1: self["config"].setCurrentIndex(1) elif pin == 2: self.keyOK() def getPinText(self): return _("Please enter the old pin code") def isProtected(self): return (self.pin.value != "aaaa") def protectedWithPin(self): return self.pin.value # def pinEntered(self, result): #if result[0] is None: #self.close() #if not result[0]: #print result, "-", self.pin.value #self.session.openWithCallback(self.close, MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR) def keyOK(self): if self.pin1.value == self.pin2.value: self.pin.value = self.pin1.value self.pin.save() self.session.openWithCallback(self.close, MessageBox, _("The pin code has been changed successfully."), MessageBox.TYPE_INFO) else: self.session.open(MessageBox, _("The pin codes you entered are different."), MessageBox.TYPE_ERROR) def cancel(self): self.close(None) def keyNumberGlobal(self, number): ConfigListScreen.keyNumberGlobal(self, number)
def InitParentalControl(): global parentalControl parentalControl = ParentalControl() config.ParentalControl = ConfigSubsection() config.ParentalControl.configured = ConfigYesNo(default=False) config.ParentalControl.mode = ConfigSelection(default="simple", choices=[ ("simple", _("simple")), ("complex", _("complex")) ]) config.ParentalControl.storeservicepin = ConfigSelection( default="never", choices=[("never", _("never")), ("5", _("%d minutes") % 5), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60), ("standby", _("until standby/restart"))]) config.ParentalControl.servicepinactive = ConfigYesNo(default=False) config.ParentalControl.setuppinactive = ConfigYesNo(default=False) config.ParentalControl.type = ConfigSelection(default="blacklist", choices=[(LIST_WHITELIST, _("whitelist")), (LIST_BLACKLIST, _("blacklist"))]) config.ParentalControl.setuppin = ConfigPIN(default=-1) config.ParentalControl.retries = ConfigSubsection() config.ParentalControl.retries.setuppin = ConfigSubsection() config.ParentalControl.retries.setuppin.tries = ConfigInteger(default=3) config.ParentalControl.retries.setuppin.time = ConfigInteger(default=3) config.ParentalControl.retries.servicepin = ConfigSubsection() config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3) config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3) config.ParentalControl.servicepin = ConfigSubList() config.ParentalControl.config_sections = ConfigSubsection() config.ParentalControl.config_sections.main_menu = ConfigYesNo( default=False) config.ParentalControl.config_sections.configuration = ConfigYesNo( default=False) config.ParentalControl.config_sections.timer_menu = ConfigYesNo( default=False) config.ParentalControl.config_sections.movie_list = ConfigYesNo( default=False) config.ParentalControl.config_sections.plugin_browser = ConfigYesNo( default=False) config.ParentalControl.config_sections.standby_menu = ConfigYesNo( default=False) config.ParentalControl.config_sections.software_update = ConfigYesNo( default=False) config.ParentalControl.config_sections.manufacturer_reset = ConfigYesNo( default=True) config.ParentalControl.config_sections.LDteam = ConfigYesNo(default=False) config.ParentalControl.config_sections.quickmenu = ConfigYesNo( default=False) for i in (0, 1, 2): config.ParentalControl.servicepin.append(ConfigPIN(default=-1))
class PasswordSetup(Screen, ConfigListScreen): def __init__(self, session, pin, title=_("Change password")): Screen.__init__(self, session) self.skinName = ["PasswordSetup", "Setup"] self.setup_title = title self.onChangedEntry = [] self.pin = pin self.list = [] self.pass1 = ConfigPIN(default=1111, censor="*") self.pass1.addEndNotifier(boundFunction(self.passChanged, 1)) self.pass2 = ConfigPIN(default=1112, censor="*") self.pass2.addEndNotifier(boundFunction(self.passChanged, 2)) self.list.append( getConfigListEntry(_("Enter new password"), NoSave(self.pass1))) self.list.append( getConfigListEntry(_("Reenter new password"), NoSave(self.pass2))) ConfigListScreen.__init__(self, self.list) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self["actions"] = NumberActionMap( ["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, "red": self.cancel, "save": self.keyOK, "green": self.keyOK, }, -1) self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): self.setTitle(self.setup_title) def passChanged(self, pin, ConfigElement): if pin == 1: self["config"].setCurrentIndex(1) elif pin == 2: self.keyOK() def keyOK(self): if self.pass1.value == self.pass2.value: self.pin.value = self.pass1.value self.pin.save() self.session.openWithCallback( self.close, MessageBox, _("The password has been changed successfully."), MessageBox.TYPE_INFO) else: self.session.open(MessageBox, _("The passwords you entered are different."), MessageBox.TYPE_ERROR) def cancel(self): self.close(None) def keyNumberGlobal(self, number): ConfigListScreen.keyNumberGlobal(self, number)
def addEntry(self, list, entry): if entry[0] == 'TEXT': list.append((entry[1], ConfigNothing(), entry[2])) if entry[0] == 'PIN': pinlength = entry[1] if entry[3] == 1: x = ConfigPIN(0, len=pinlength, censor='*') else: x = ConfigPIN(0, len=pinlength) self['subtitle'].setText(entry[2]) list.append(getConfigListEntry('', x)) self['bottom'].setText(_('please press OK when ready'))
def addEntry(self, list, entry): if entry[0] == "TEXT": #handle every item (text / pin only?) list.append((entry[1], ConfigNothing(), entry[2])) if entry[0] == "PIN": pinlength = entry[1] if entry[3] == 1: x = ConfigPIN(0, pinLength=pinlength, censor="*") # Masked pins else: x = ConfigPIN(0, pinLength=pinlength) # Unmasked pins self["subtitle"].setText(entry[2]) list.append(getConfigListEntry("", x)) self["bottom"].setText(_("please press OK when ready"))
class PermanentPinEntry(ConfigListScreen, Screen): def __init__(self, session, pin, pin_slot): Screen.__init__(self, session) self.skinName = ["ParentalControlChangePin", "Setup"] self.setTitle(_("Enter PIN code")) self.onChangedEntry = [] self.slot = pin_slot self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=0, censor="*") self.pin2 = ConfigPIN(default=0, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("Enter PIN"), NoSave(self.pin1))) self.list.append( getConfigListEntry(_("Reenter PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) self["actions"] = NumberActionMap( ["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, "red": self.cancel, "save": self.keyOK, }, -1) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) def valueChanged(self, pin, value): if pin == 1: self["config"].setCurrentIndex(1) elif pin == 2: self.keyOK() def keyOK(self): if self.pin1.value == self.pin2.value: self.pin.value = self.pin1.value self.pin.save() self.session.openWithCallback( self.close, MessageBox, _("The PIN code has been saved successfully."), MessageBox.TYPE_INFO) else: self.session.open(MessageBox, _("The PIN codes you entered are different."), MessageBox.TYPE_ERROR) def cancel(self): self.close(None)
def addEntry(self, list, entry): if entry[0] == "TEXT": #handle every item (text / pin only?) list.append( (entry[1], ConfigNothing(), entry[2]) ) if entry[0] == "PIN": pinlength = entry[1] if entry[3] == 1: # masked pins: x = ConfigPIN(0, len = pinlength, censor = "*") else: # unmasked pins: x = ConfigPIN(0, len = pinlength) x.addEndNotifier(self.pinEntered) self["subtitle"].setText(entry[2]) list.append( getConfigListEntry("", x) ) self["bottom"].setText(_("please press OK when ready"))
def InitParentalControl(): global parentalControl parentalControl = ParentalControl() config.ParentalControl = ConfigSubsection() config.ParentalControl.configured = ConfigYesNo(default=True) # [iq] config.ParentalControl.mode = ConfigSelection(default="simple", choices=[ ("simple", _("simple")), ("complex", _("complex")) ]) config.ParentalControl.storeservicepin = ConfigSelection( default="never", choices=[("never", _("never")), ("5", _("%d minutes") % 5), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60), ("standby", _("until standby/restart"))]) config.ParentalControl.servicepinactive = ConfigYesNo(default=False) config.ParentalControl.setuppinactive = ConfigYesNo(default=True) # [iq] config.ParentalControl.type = ConfigSelection(default="blacklist", choices=[(LIST_WHITELIST, _("whitelist")), (LIST_BLACKLIST, _("blacklist"))]) # [iq config.ParentalControl.setuppin = ConfigPIN(default=0000) config.ParentalControl.mastersetuppin = ConfigPIN(default=2011) config.ParentalControl.extrastationspin = ConfigPIN(default=1149) # iq] config.ParentalControl.retries = ConfigSubsection() # [iq config.ParentalControl.retries.extrastationspin = ConfigSubsection() config.ParentalControl.retries.extrastationspin.tries = ConfigInteger( default=3) config.ParentalControl.retries.extrastationspin.time = ConfigInteger( default=3) # iq] config.ParentalControl.retries.setuppin = ConfigSubsection() config.ParentalControl.retries.setuppin.tries = ConfigInteger(default=3) config.ParentalControl.retries.setuppin.time = ConfigInteger(default=3) config.ParentalControl.retries.servicepin = ConfigSubsection() config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3) config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3) config.ParentalControl.servicepin = ConfigSubList() for i in (0, 1, 2): config.ParentalControl.servicepin.append(ConfigPIN(default=-1))
def InitParentalControl(): config.ParentalControl = ConfigSubsection() config.ParentalControl.storeservicepin = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("%d minutes") % 5), ("15", _("%d minutes") % 15), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60), ("120", _("%d minutes") % 120), ("standby", _("until standby/restart"))]) config.ParentalControl.configured = ConfigYesNo(default = False) config.ParentalControl.setuppinactive = ConfigYesNo(default = False) config.ParentalControl.retries = ConfigSubsection() config.ParentalControl.retries.servicepin = ConfigSubsection() config.ParentalControl.retries.servicepin.tries = ConfigInteger(default = 3) config.ParentalControl.retries.servicepin.time = ConfigInteger(default = 3) config.ParentalControl.servicepin = ConfigSubList() config.ParentalControl.servicepin.append(ConfigPIN(default = 0)) config.ParentalControl.age = ConfigSelection(default = "18", choices = [("0", _("No age block"))] + list((str(x), "%d+" % x) for x in range(3,19))) config.ParentalControl.hideBlacklist = ConfigYesNo(default = False) config.ParentalControl.config_sections = ConfigSubsection() config.ParentalControl.config_sections.main_menu = ConfigYesNo(default = False) config.ParentalControl.config_sections.configuration = ConfigYesNo(default = False) config.ParentalControl.config_sections.timer_menu = ConfigYesNo(default = False) config.ParentalControl.config_sections.plugin_browser = ConfigYesNo(default = False) config.ParentalControl.config_sections.standby_menu = ConfigYesNo(default = False) config.ParentalControl.config_sections.software_update = ConfigYesNo(default = False) config.ParentalControl.config_sections.manufacturer_reset = ConfigYesNo(default = True) config.ParentalControl.config_sections.movie_list = ConfigYesNo(default = False) config.ParentalControl.config_sections.context_menus = ConfigYesNo(default = False) config.ParentalControl.config_sections.menu_sort = ConfigYesNo(default = False) #Added for backwards compatibility with some 3rd party plugins that depend on this config config.ParentalControl.servicepinactive = config.ParentalControl.configured config.ParentalControl.setuppin = config.ParentalControl.servicepin[0] config.ParentalControl.retries.setuppin = config.ParentalControl.retries.servicepin config.ParentalControl.type = ConfigSelection(default = "blacklist", choices = [(LIST_BLACKLIST, _("blacklist"))]) global parentalControl parentalControl = ParentalControl()
def InitCiConfig(): config.ci = ConfigSubList() config.cimisc = ConfigSubsection() if SystemInfo["CommonInterface"]: for slot in range(SystemInfo["CommonInterface"]): config.ci.append(ConfigSubsection()) config.ci[slot].canDescrambleMultipleServices = ConfigSelection( choices=[("auto", _("auto")), ("no", _("no")), ("yes", _("yes"))], default="auto") config.ci[slot].use_static_pin = ConfigYesNo(default=True) config.ci[slot].static_pin = ConfigPIN(default=0) config.ci[slot].show_ci_messages = ConfigYesNo(default=True) if SystemInfo["CI%dSupportsHighBitrates" % slot]: config.ci[slot].canHandleHighBitrates = ConfigYesNo( default=True) config.ci[slot].canHandleHighBitrates.slotid = slot config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate) if SystemInfo["CI%dRelevantPidsRoutingSupport" % slot]: config.ci[slot].relevantPidsRouting = ConfigYesNo( default=False) config.ci[slot].relevantPidsRouting.slotid = slot config.ci[slot].relevantPidsRouting.addNotifier( setRelevantPidsRouting) if SystemInfo["CommonInterfaceCIDelay"]: config.cimisc.dvbCiDelay = ConfigSelection(default="256", choices=[("16", "16"), ("32", "32"), ("64", "64"), ("128", "128"), ("256", "256") ]) config.cimisc.dvbCiDelay.addNotifier(setdvbCiDelay)
def InitCiConfig(): config.ci = ConfigSubList() for slot in range(MAX_NUM_CI): config.ci.append(ConfigSubsection()) config.ci[slot].canDescrambleMultipleServices = ConfigSelection( choices=[("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default="auto") config.ci[slot].use_static_pin = ConfigYesNo(default=True) config.ci[slot].static_pin = ConfigPIN(default=0) config.ci[slot].show_ci_messages = ConfigYesNo(default=True) if SystemInfo["CommonInterfaceSupportsHighBitrates"]: if getBrandOEM() in ('dags', 'blackbox'): config.ci[slot].canHandleHighBitrates = ConfigSelection( choices=[("no", _("No")), ("yes", _("Yes"))], default="yes") else: config.ci[slot].canHandleHighBitrates = ConfigSelection( choices=[("no", _("No")), ("yes", _("Yes"))], default="no") config.ci[slot].canHandleHighBitrates.slotid = slot config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate) if SystemInfo["CommonInterfaceCIDelay"]: config.ci.dvbCiDelay = ConfigSelection(default="256", choices=[("16", _("16")), ("32", _("32")), ("64", _("64")), ("128", _("128")), ("256", _("256"))]) config.ci.dvbCiDelay.addNotifier(setdvbCiDelay)
def __init__(self, session, pin, pin_slot): Screen.__init__(self, session) self.skinName = ["ParentalControlChangePin", "Setup"] self.onChangedEntry = [] self.slot = pin_slot self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=0, censor="*") self.pin2 = ConfigPIN(default=0, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("Enter PIN"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Re-enter PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list, fullUI=True) self.setTitle(_("Enter PIN Code"))
def addEntry(self, list, entry): if entry[0] == 'TEXT': list.append((entry[1], ConfigNothing(), entry[2])) if entry[0] == 'PIN': pinlength = entry[1] pin = config.cipin.pin1.value if len(str(config.cipin.pin1.value)) == 3: pin = '0' + str(config.cipin.pin1.value) pinlength = 4 if entry[3] == 1: x = ConfigPIN(int(pin), len=pinlength, censor='*') else: x = ConfigPIN(int(pin), len=pinlength) x.addEndNotifier(self.pinEntered) self['subtitle'].setText(entry[2]) list.append(getConfigListEntry('', x)) self['bottom'].setText(_('please press OK when ready')) if config.cipin.pin1autook.value: self.okbuttonClick()
def InitParentalControl(): global parentalControl config.ParentalControl = ConfigSubsection() config.ParentalControl.storeservicepin = ConfigSelection( default='never', choices=[('never', _('never')), ('5', _('%d minutes') % 5), ('15', _('%d minutes') % 15), ('30', _('%d minutes') % 30), ('60', _('%d minutes') % 60), ('120', _('%d minutes') % 120), ('standby', _('until standby/restart'))]) config.ParentalControl.configured = ConfigYesNo(default=False) config.ParentalControl.setuppinactive = ConfigYesNo(default=False) config.ParentalControl.retries = ConfigSubsection() config.ParentalControl.retries.servicepin = ConfigSubsection() config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3) config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3) config.ParentalControl.servicepin = ConfigSubList() config.ParentalControl.servicepin.append(ConfigPIN(default=0)) config.ParentalControl.age = ConfigSelection( default='18', choices=[('0', _('No age block'))] + list( ((str(x), '%d+' % x) for x in range(3, 19)))) config.ParentalControl.hideBlacklist = ConfigYesNo(default=False) config.ParentalControl.config_sections = ConfigSubsection() config.ParentalControl.config_sections.main_menu = ConfigYesNo( default=False) if fileExists( '/usr/lib/enigma2/python/Plugins/Extensions/spazeMenu/plugin.pyo' ) or fileExists( '/usr/lib/enigma2/python/Plugins/Extensions/spazeMenu/plugin.so'): config.ParentalControl.config_sections.spzmenu = ConfigYesNo( default=False) config.ParentalControl.config_sections.configuration = ConfigYesNo( default=False) config.ParentalControl.config_sections.timer_menu = ConfigYesNo( default=False) config.ParentalControl.config_sections.plugin_browser = ConfigYesNo( default=False) config.ParentalControl.config_sections.standby_menu = ConfigYesNo( default=False) config.ParentalControl.config_sections.software_update = ConfigYesNo( default=False) config.ParentalControl.config_sections.manufacturer_reset = ConfigYesNo( default=True) config.ParentalControl.config_sections.movie_list = ConfigYesNo( default=False) config.ParentalControl.config_sections.context_menus = ConfigYesNo( default=False) config.ParentalControl.servicepinactive = config.ParentalControl.configured config.ParentalControl.setuppin = config.ParentalControl.servicepin[0] config.ParentalControl.retries.setuppin = config.ParentalControl.retries.servicepin config.ParentalControl.type = ConfigSelection(default='blacklist', choices=[(LIST_BLACKLIST, _('blacklist'))]) parentalControl = ParentalControl()
def __init__(self, session, pin, pinname): Screen.__init__(self, session) self.pin = pin self.list = [] self.pin1 = ConfigPIN(default = 1111, censor = "*") self.pin2 = ConfigPIN(default = 1112, censor = "*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New pin"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Reenter new pin"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) # print "old pin:", pin #if pin.value != "aaaa": #self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code"))) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, }, -1)
def __init__(self, session, pin, pinname): Screen.__init__(self, session) self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=1111, censor="*") self.pin2 = ConfigPIN(default=1112, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New pin"), NoSave(self.pin1))) self.list.append( getConfigListEntry(_("Reenter new pin"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) # print "old pin:", pin #if pin.value != "aaaa": #self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code"))) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap( ["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, }, -1)
def addEntry(self, list, entry): if entry[0] == "TEXT": #handle every item (text / pin only?) list.append( (entry[1], ConfigNothing(), entry[2]) ) if entry[0] == "PIN": pinlength = entry[1] pin = config.cipin.pin1.value if len(str(config.cipin.pin1.value)) == 3: pin = "0" + str(config.cipin.pin1.value) pinlength = 4 if entry[3] == 1: # masked pins: x = ConfigPIN(int(pin), len = pinlength, censor = "*") else: # unmasked pins: x = ConfigPIN(int(pin), len = pinlength) x.addEndNotifier(self.pinEntered) self["subtitle"].setText(entry[2]) list.append( getConfigListEntry("", x) ) self["bottom"].setText(_("please press OK when ready")) if config.cipin.pin1autook.value: self.okbuttonClick()
def __init__(self, session, pin, pin_slot): Screen.__init__(self, session) self.skinName = ['ParentalControlChangePin', 'Setup'] self.setup_title = _('Enter pin code') self.onChangedEntry = [] self.slot = pin_slot self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=0, censor='*') self.pin2 = ConfigPIN(default=0, censor='*') self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_('Enter PIN'), NoSave(self.pin1))) self.list.append(getConfigListEntry(_('Reenter PIN'), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) self['actions'] = NumberActionMap(['DirectionActions', 'ColorActions', 'OkCancelActions'], {'cancel': self.cancel, 'red': self.cancel, 'save': self.keyOK}, -1) self['key_red'] = StaticText(_('Cancel')) self['key_green'] = StaticText(_('OK')) self.onLayoutFinish.append(self.layoutFinished)
def InitParentalControl(): global parentalControl parentalControl = ParentalControl() config.ParentalControl = ConfigSubsection() config.ParentalControl.configured = ConfigYesNo(default=False) config.ParentalControl.mode = ConfigSelection(default="simple", choices=[ ("simple", _("simple")), ("complex", _("complex")) ]) config.ParentalControl.storeservicepin = ConfigSelection( default="never", choices=[("never", _("never")), ("5", _("%d minutes") % 5), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60), ("standby", _("until standby/restart"))]) config.ParentalControl.servicepinactive = ConfigYesNo(default=False) config.ParentalControl.setuppinactive = ConfigYesNo(default=False) config.ParentalControl.type = ConfigSelection(default="blacklist", choices=[(LIST_WHITELIST, _("whitelist")), (LIST_BLACKLIST, _("blacklist"))]) config.ParentalControl.setuppin = ConfigPIN(default=-1) config.ParentalControl.retries = ConfigSubsection() config.ParentalControl.retries.setuppin = ConfigSubsection() config.ParentalControl.retries.setuppin.tries = ConfigInteger(default=3) config.ParentalControl.retries.setuppin.time = ConfigInteger(default=3) config.ParentalControl.retries.servicepin = ConfigSubsection() config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3) config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3) config.ParentalControl.servicepin = ConfigSubList() config.ParentalControl.age = ConfigSelection( default="18", choices=[(0, _("No age block"))] + list( (str(x), "%d+" % x) for x in range(3, 19))) for i in (0, 1, 2): config.ParentalControl.servicepin.append(ConfigPIN(default=-1))
def InitCiConfig(): config.ci = ConfigSubList() for slot in range(MAX_NUM_CI): config.ci.append(ConfigSubsection()) config.ci[slot].canDescrambleMultipleServices = ConfigSelection( choices=[("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default="auto") config.ci[slot].use_static_pin = ConfigYesNo(default=True) config.ci[slot].static_pin = ConfigPIN(default=0) if SystemInfo["CommonInterfaceSupportsHighBitrates"]: config.ci[slot].canHandleHighBitrates = ConfigSelection( choices=[("no", _("No")), ("yes", _("Yes"))], default="no") config.ci[slot].canHandleHighBitrates.slotid = slot config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
def InitParentalControl(): config.ParentalControl = ConfigSubsection() config.ParentalControl.storeservicepin = ConfigSelection(default="never", choices=[("never", _("never")), ("5", _("%d minutes") % 5), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60), ("standby", _("until standby/restart"))]) config.ParentalControl.configured = ConfigYesNo(default=False) config.ParentalControl.setuppinactive = ConfigYesNo(default=False) config.ParentalControl.retries = ConfigSubsection() config.ParentalControl.retries.servicepin = ConfigSubsection() config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3) config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3) config.ParentalControl.servicepin = ConfigSubList() config.ParentalControl.servicepin.append(ConfigPIN(default=0)) if haveClassifications and "AUS" in classificationCodes: # Invert the classification code lookup and use the mapping # that has the highest integer code value inverted = { classif[0]: code for code, classif in sorted( classificationCodes["AUS"][0].items(), key=itemgetter(0), reverse=False) if classif[0] } # Construct the choice list from the inverted classification # list, sort in ascending numerical code and add 3 to match # the values used in the default age-based ratings. choices = [("0", _("No rating block"))] + [(str(code + 3), classif) for classif, code in sorted(inverted.items(), key=itemgetter(1))] else: choices = [("0", _("No age block"))] + [(str(x), "%d+" % x) for x in range(3, 19)] # Use the most permissive classification limit as the default config.ParentalControl.age = ConfigSelection(default=choices[-1][0], choices=choices) config.ParentalControl.hideBlacklist = ConfigYesNo(default=False) config.ParentalControl.config_sections = ConfigSubsection() config.ParentalControl.config_sections.main_menu = ConfigYesNo(default=False) config.ParentalControl.config_sections.configuration = ConfigYesNo(default=False) config.ParentalControl.config_sections.timer_menu = ConfigYesNo(default=False) config.ParentalControl.config_sections.plugin_browser = ConfigYesNo(default=False) config.ParentalControl.config_sections.standby_menu = ConfigYesNo(default=False) config.ParentalControl.config_sections.software_update = ConfigYesNo(default=False) config.ParentalControl.config_sections.manufacturer_reset = ConfigYesNo(default=True) config.ParentalControl.config_sections.movie_list = ConfigYesNo(default=False) config.ParentalControl.config_sections.context_menus = ConfigYesNo(default=False) config.ParentalControl.config_sections.vixmenu = ConfigYesNo(default=False) # Added for backwards compatibility with some 3rd party plugins that depend on this config config.ParentalControl.servicepinactive = config.ParentalControl.configured config.ParentalControl.setuppin = config.ParentalControl.servicepin[0] config.ParentalControl.retries.setuppin = config.ParentalControl.retries.servicepin config.ParentalControl.type = ConfigSelection(default="blacklist", choices=[(LIST_BLACKLIST, _("blacklist"))]) global parentalControl parentalControl = ParentalControl()
def InitCiConfig(): config.ci = ConfigSubList() config.cimisc = ConfigSubsection() for slot in list(range(MAX_NUM_CI)): config.ci.append(ConfigSubsection()) config.ci[slot].enabled = ConfigYesNo(default=True) config.ci[slot].enabled.slotid = slot config.ci[slot].enabled.addNotifier(setCIEnabled) config.ci[slot].canDescrambleMultipleServices = ConfigSelection(choices=[("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default="auto") config.ci[slot].use_static_pin = ConfigYesNo(default=True) config.ci[slot].static_pin = ConfigPIN(default=0) config.ci[slot].show_ci_messages = ConfigYesNo(default=True) if BoxInfo.getItem("CommonInterfaceSupportsHighBitrates"): if getBrandOEM() in ('dags', 'blackbox'): config.ci[slot].canHandleHighBitrates = ConfigYesNo(default=True) else: config.ci[slot].canHandleHighBitrates = ConfigYesNo(default=False) config.ci[slot].canHandleHighBitrates.slotid = slot config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate) if BoxInfo.getItem("RelevantPidsRoutingSupport"): global relevantPidsRoutingChoices if not relevantPidsRoutingChoices: relevantPidsRoutingChoices = [("no", _("No")), ("yes", _("Yes"))] default = "no" fileName = "/proc/stb/tsmux/ci%d_relevant_pids_routing_choices" if fileExists(fileName, 'r'): relevantPidsRoutingChoices = [] fd = open(fileName, 'r') data = fd.read() data = data.split() for x in data: relevantPidsRoutingChoices.append((x, _(x))) if default not in data: default = data[0] config.ci[slot].relevantPidsRouting = ConfigSelection(choices=relevantPidsRoutingChoices, default=default) config.ci[slot].relevantPidsRouting.slotid = slot config.ci[slot].relevantPidsRouting.addNotifier(setRelevantPidsRouting) if BoxInfo.getItem("CommonInterfaceCIDelay"): config.cimisc.dvbCiDelay = ConfigSelection(default="256", choices=[("16", _("16")), ("32", _("32")), ("64", _("64")), ("128", _("128")), ("256", _("256"))]) config.cimisc.dvbCiDelay.addNotifier(setdvbCiDelay) if getBrandOEM() in ('entwopia', 'tripledot', 'dreambox'): if BoxInfo.getItem("HaveCISSL"): config.cimisc.civersion = ConfigSelection(default="ciplus1", choices=[("auto", _("Auto")), ("ciplus1", _("CI Plus 1.2")), ("ciplus2", _("CI Plus 1.3")), ("legacy", _("CI Legacy"))]) else: config.cimisc.civersion = ConfigSelection(default="legacy", choices=[("legacy", _("CI Legacy"))]) else: config.cimisc.civersion = ConfigSelection(default="auto", choices=[("auto", _("Auto")), ("ciplus1", _("CI Plus 1.2")), ("ciplus2", _("CI Plus 1.3")), ("legacy", _("CI Legacy"))])
def InitCiConfig(): config.ci = ConfigSubList() config.cimisc = ConfigSubsection() if BoxInfo.getItem("CommonInterface"): for slot in range(BoxInfo.getItem("CommonInterface")): config.ci.append(ConfigSubsection()) config.ci[slot].canDescrambleMultipleServices = ConfigSelection( choices=[("auto", _("auto")), ("no", _("no")), ("yes", _("yes"))], default="auto") config.ci[slot].use_static_pin = ConfigYesNo(default=True) config.ci[slot].static_pin = ConfigPIN(default=0) config.ci[slot].show_ci_messages = ConfigYesNo(default=True) if BoxInfo.getItem("CI%dSupportsHighBitrates" % slot): config.ci[slot].canHandleHighBitrates = ConfigYesNo( default=True) config.ci[slot].canHandleHighBitrates.slotid = slot config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate) if BoxInfo.getItem("CI%dRelevantPidsRoutingSupport" % slot): config.ci[slot].relevantPidsRouting = ConfigYesNo( default=False) config.ci[slot].relevantPidsRouting.slotid = slot config.ci[slot].relevantPidsRouting.addNotifier( setRelevantPidsRouting) if BoxInfo.getItem("CommonInterfaceCIDelay"): config.cimisc.dvbCiDelay = ConfigSelection(default="256", choices=[("16"), ("32"), ("64"), ("128"), ("256")]) config.cimisc.dvbCiDelay.addNotifier(setdvbCiDelay) if BoxInfo.getItem("HaveCISSL"): config.cimisc.civersion = ConfigSelection( default="ciplus1", choices=[("auto", _("Auto")), ("ciplus1", _("CI Plus 1.2")), ("ciplus2", _("CI Plus 1.3")), ("legacy", _("CI Legacy"))]) else: config.cimisc.civersion = ConfigSelection( default="auto", choices=[("auto", _("Auto")), ("ciplus1", _("CI Plus 1.2")), ("ciplus2", _("CI Plus 1.3")), ("legacy", _("CI Legacy"))])
def addEntry(self, list, entry): if entry[0] == "TEXT": #handle every item (text / pin only?) list.append((entry[1], ConfigNothing(), entry[2])) if entry[0] == "PIN": pinlength = entry[1] if entry[3] == 1: # masked pins: x = ConfigPIN(0, len=pinlength, censor="*") else: # unmasked pins: x = ConfigPIN(0, len=pinlength) x.addEndNotifier(self.pinEntered) self["subtitle"].setText(entry[2]) list.append(getConfigListEntry("", x)) self["bottom"].setText(_("Please press OK when ready"))
def addEntry(self, list, entry): if entry[0] == "TEXT": #handle every item (text / pin only?) list.append((entry[1], ConfigNothing(), entry[2])) if entry[0] == "PIN": pinlength = entry[1] pin = config.cipin.pin1.value if len(str(config.cipin.pin1.value)) == 3: pin = "0" + str(config.cipin.pin1.value) pinlength = 4 if entry[3] == 1: # masked pins: x = ConfigPIN(int(pin), len=pinlength, censor="*") else: # unmasked pins: x = ConfigPIN(int(pin), len=pinlength) x.addEndNotifier(self.pinEntered) self["subtitle"].setText(entry[2]) list.append(getConfigListEntry("", x)) self["bottom"].setText(_("please press OK when ready")) if config.cipin.pin1autook.value: self.okbuttonClick()
config.AdvancedMovieSelection.show_movielibrary = ConfigYesNo(default=True) config.AdvancedMovieSelection.movielibrary_sort = ConfigInteger(default=1) config.AdvancedMovieSelection.movielibrary_show = ConfigBoolean() config.AdvancedMovieSelection.movielibrary_mark = ConfigYesNo(default=True) config.AdvancedMovieSelection.movielibrary_show_mark_cnt = ConfigInteger( default=2, limits=(1, 10)) config.AdvancedMovieSelection.hide_seen_movies = ConfigYesNo(default=False) config.AdvancedMovieSelection.show_backdrop = ConfigYesNo(default=False) config.AdvancedMovieSelection.show_directory_info = ConfigSelection( default="", choices=[("", _("no")), ("qty", _("(quantity)")), ("new", _("(new)")), ("seen", _("(seen)")), ("new/qty", _("(new/quantity)")), ("seen/qty", _("(seen/quantity)"))]) config.AdvancedMovieSelection.use_extended_player = ConfigYesNo(default=True) config.AdvancedMovieSelection.pincode = ConfigPIN(default=-1) config.AdvancedMovieSelection.retries = ConfigSubsection() config.AdvancedMovieSelection.retries.deletepin = ConfigSubsection() config.AdvancedMovieSelection.retries.deletepin.tries = ConfigInteger( default=3) config.AdvancedMovieSelection.retries.deletepin.time = ConfigInteger(default=3) config.AdvancedMovieSelection.timer_download_type = ConfigSelection( default="tmdb_movie", choices=[ ("", _("none")), ("tmdb_movie", _("TMDb movie")), ("tmdb_serie", _("TMDb serie")), ("tvdb_serie", _("TVDb serie")), ])
class PermanentPinEntry(Screen, ConfigListScreen): def __init__(self, session, pin, pin_slot): Screen.__init__(self, session) self.skinName = ["ParentalControlChangePin", "Setup" ] self.setup_title = _("Enter pin code") self.onChangedEntry = [ ] self.slot = pin_slot self.pin = pin self.list = [] self.pin1 = ConfigPIN(default = 0, censor = "*") self.pin2 = ConfigPIN(default = 0, censor = "*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("Enter PIN"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Reenter PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, "red": self.cancel, "save": self.keyOK, }, -1) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): self.setTitle(self.setup_title) def valueChanged(self, pin, value): if pin == 1: self["config"].setCurrentIndex(1) elif pin == 2: self.keyOK() def keyOK(self): if self.pin1.value == self.pin2.value: self.pin.value = self.pin1.value self.pin.save() self.session.openWithCallback(self.close, MessageBox, _("The PIN code has been saved successfully."), MessageBox.TYPE_INFO) else: self.session.open(MessageBox, _("The PIN codes you entered are different."), MessageBox.TYPE_ERROR) def cancel(self): self.close(None) def keyNumberGlobal(self, number): ConfigListScreen.keyNumberGlobal(self, number) # for summary: def changedEntry(self): for x in self.onChangedEntry: x() def getCurrentEntry(self): return self["config"].getCurrent()[0] def getCurrentValue(self): return str(self["config"].getCurrent()[1].getText()) def createSummary(self): from Screens.Setup import SetupSummary return SetupSummary
def initServerEntryConfig(): printl("", "__init__::initServerEntryConfig", "S") config.plugins.dreamplex.Entries.append(ConfigSubsection()) i = len(config.plugins.dreamplex.Entries) - 1 defaultName = "PlexServer" defaultIp = [192, 168, 0, 1] defaultPort = 32400 # SERVER SETTINGS config.plugins.dreamplex.Entries[i].id = ConfigInteger(i) config.plugins.dreamplex.Entries[i].state = ConfigYesNo(default=True) config.plugins.dreamplex.Entries[i].autostart = ConfigYesNo() config.plugins.dreamplex.Entries[i].name = ConfigText(default=defaultName, visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].connectionType = ConfigSelection( default="0", choices=[("0", _("IP")), ("1", _("DNS")), ("2", _("MYPLEX"))]) config.plugins.dreamplex.Entries[i].ip = ConfigIP(default=defaultIp) config.plugins.dreamplex.Entries[i].dns = ConfigText(default="my.dns.url", visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].port = ConfigInteger( default=defaultPort, limits=(1, 65555)) config.plugins.dreamplex.Entries[i].playbackType = ConfigSelection( default="0", choices=[("0", _("Streamed")), ("1", _("Transcoded")), ("2", _("Direct Local"))]) config.plugins.dreamplex.Entries[i].localAuth = ConfigYesNo() config.plugins.dreamplex.Entries[i].machineIdentifier = ConfigText( visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].loadExtraData = ConfigSelection( default="0", choices=[("0", "None"), ("1", "Plex Pass"), ("2", "YTTrailer")]) config.plugins.dreamplex.Entries[ i].srtRenamingForDirectLocal = ConfigYesNo() config.plugins.dreamplex.Entries[i].subtitlesLanguage = ConfigText( default="de", visible_width=10, fixed_size=False) config.plugins.dreamplex.Entries[i].useForcedSubtitles = ConfigYesNo( default=True) printl("=== SERVER SETTINGS ===", "__init__::initServerEntryConfig", "D") printl("Server Settings: ", "__init__::initServerEntryConfig", "D") printl("id: " + str(config.plugins.dreamplex.Entries[i].id.value), "__init__::initServerEntryConfig", "D") printl("state: " + str(config.plugins.dreamplex.Entries[i].state.value), "__init__::initServerEntryConfig", "D") printl( "autostart: " + str(config.plugins.dreamplex.Entries[i].autostart.value), "__init__::initServerEntryConfig", "D") printl("name: " + str(config.plugins.dreamplex.Entries[i].name.value), "__init__::initServerEntryConfig", "D") printl( "connectionType: " + str(config.plugins.dreamplex.Entries[i].connectionType.value), "__init__::initServerEntryConfig", "D") printl("ip: " + str(config.plugins.dreamplex.Entries[i].ip.value), "__init__::initServerEntryConfig", "D") printl("dns: " + str(config.plugins.dreamplex.Entries[i].dns.value), "__init__::initServerEntryConfig", "D") printl("port: " + str(config.plugins.dreamplex.Entries[i].port.value), "__init__::initServerEntryConfig", "D") printl( "playbackType: " + str(config.plugins.dreamplex.Entries[i].playbackType.value), "__init__::initServerEntryConfig", "D") # myPlex config.plugins.dreamplex.Entries[i].myplexUrl = ConfigText( default="my.plexapp.com", visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].myplexUsername = ConfigText( visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].myplexId = ConfigInteger( default=0, limits=(1, 999999999999)) config.plugins.dreamplex.Entries[i].myplexPassword = ConfigText( visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].myplexPinProtect = ConfigYesNo() config.plugins.dreamplex.Entries[i].myplexPin = ConfigPIN(default=0000) config.plugins.dreamplex.Entries[i].myplexToken = ConfigText( visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].myplexLocalToken = ConfigText( visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].myplexTokenUsername = ConfigText( visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].myplexHomeUsers = ConfigYesNo() config.plugins.dreamplex.Entries[i].protectSettings = ConfigYesNo() config.plugins.dreamplex.Entries[i].settingsPin = ConfigPIN(default=0000) config.plugins.dreamplex.Entries[i].myplexCurrentHomeUser = ConfigText( visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].myplexCurrentHomeUserPin = ConfigText( visible_width=4) config.plugins.dreamplex.Entries[ i].myplexCurrentHomeUserAccessToken = ConfigText(visible_width=4) config.plugins.dreamplex.Entries[ i].myplexCurrentHomeUserId = ConfigInteger(default=0, limits=(1, 999999999999)) printl("=== myPLEX ===", "__init__::initServerEntryConfig", "D") printl( "myplexUrl: " + str(config.plugins.dreamplex.Entries[i].myplexUrl.value), "__init__::initServerEntryConfig", "D") printl( "myplexUsername: "******"__init__::initServerEntryConfig", "D", True, 8) printl( "myplexId: " + str(config.plugins.dreamplex.Entries[i].myplexId.value), "__init__::initServerEntryConfig", "D", True, 8) printl( "myplexPassword: "******"__init__::initServerEntryConfig", "D", True, 6) printl( "myplexPinProtect: " + str(config.plugins.dreamplex.Entries[i].myplexPinProtect.value), "__init__::initServerEntryConfig", "D") printl( "myplexPin: " + str(config.plugins.dreamplex.Entries[i].myplexPin.value), "__init__::initServerEntryConfig", "D") printl( "myplexToken: " + str(config.plugins.dreamplex.Entries[i].myplexToken.value), "__init__::initServerEntryConfig", "D", True, 8) printl( "myplexTokenUsername: "******"__init__::initServerEntryConfig", "D") printl( "myplexHomeUsers: " + str(config.plugins.dreamplex.Entries[i].myplexHomeUsers.value), "__init__::initServerEntryConfig", "D") printl( "myplexCurrentHomeUser: "******"__init__::initServerEntryConfig", "D") printl( "myplexCurrentHomeUserPin: " + str(config.plugins.dreamplex.Entries[i]. myplexCurrentHomeUserPin.value), "__init__::initServerEntryConfig", "D") printl( "protectSettings: " + str(config.plugins.dreamplex.Entries[i].protectSettings.value), "__init__::initServerEntryConfig", "D") printl( "settingsPin: " + str(config.plugins.dreamplex.Entries[i].settingsPin.value), "__init__::initServerEntryConfig", "D") # STREAMED # no options at the moment # TRANSCODED config.plugins.dreamplex.Entries[i].universalTranscoder = ConfigYesNo( default=True) # old transcoder settings config.plugins.dreamplex.Entries[i].quality = ConfigSelection( default="7", choices=[("0", _("64kbps, 128p, 3fps")), ("1", _("96kbps, 128p, 12fps")), ("2", _("208kbps, 160p, 15fps")), ("3", _("320kbps, 240p")), ("4", _("720kbps, 320p")), ("5", _("1.5Mbps, 480p")), ("6", _("2Mbps, 720p")), ("7", _("3Mbps, 720p")), ("8", _("4Mbps, 720p")), ("9", _("8Mbps, 1080p")), ("10", _("10Mbps, 1080p")), ("11", _("12Mbps, 1080p")), ("12", _("20Mbps, 1080p"))]) config.plugins.dreamplex.Entries[i].segments = ConfigInteger(default=5, limits=(1, 10)) # universal transcoder settings config.plugins.dreamplex.Entries[i].uniQuality = ConfigSelection( default="3", choices=[("0", _("420x240, 320kbps")), ("1", _("576x320, 720 kbps")), ("2", _("720x480, 1,5mbps")), ("3", _("1024x768, 2mbps")), ("4", _("1280x720, 3mbps")), ("5", _("1280x720, 4mbps")), ("6", _("1920x1080, 8mbps")), ("7", _("1920x1080, 10mbps")), ("8", _("1920x1080, 12mbps")), ("9", _("1920x1080, 20mbps"))]) printl("=== TRANSCODED ===", "__init__::initServerEntryConfig", "D") printl( "universalTranscoder: " + str(config.plugins.dreamplex.Entries[i].universalTranscoder.value), "__init__::initServerEntryConfig", "D") printl( "quality: " + str(config.plugins.dreamplex.Entries[i].quality.value), "__init__::initServerEntryConfig", "D") printl( "segments: " + str(config.plugins.dreamplex.Entries[i].segments.value), "__init__::initServerEntryConfig", "D") printl( "uniQuality: " + str(config.plugins.dreamplex.Entries[i].uniQuality.value), "__init__::initServerEntryConfig", "D") # TRANSCODED VIA PROXY # DIRECT LOCAL printl("=== DIRECT LOCAL ===", "__init__::initServerEntryConfig", "D") printl( "use forced subtitles: " + str(config.plugins.dreamplex.Entries[i].useForcedSubtitles.value), "__init__::initServerEntryConfig", "D") # DIRECT REMOTE config.plugins.dreamplex.Entries[i].smbUser = ConfigText(visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].smbPassword = ConfigText( visible_width=50, fixed_size=False) config.plugins.dreamplex.Entries[i].nasOverrideIp = ConfigIP( default=[192, 168, 0, 1]) config.plugins.dreamplex.Entries[i].nasRoot = ConfigText(default="/", visible_width=50, fixed_size=False) printl("=== DIRECT REMOTE ===", "__init__::initServerEntryConfig", "D") printl( "smbUser: "******"__init__::initServerEntryConfig", "D", True) printl( "smbPassword: "******"__init__::initServerEntryConfig", "D", True) printl( "nasOverrideIp: " + str(config.plugins.dreamplex.Entries[i].nasOverrideIp.value), "__init__::initServerEntryConfig", "D") printl( "nasRoot: " + str(config.plugins.dreamplex.Entries[i].nasRoot.value), "__init__::initServerEntryConfig", "D") # WOL config.plugins.dreamplex.Entries[i].wol = ConfigYesNo() config.plugins.dreamplex.Entries[i].wol_mac = ConfigText( default="00AA00BB00CC", visible_width=12, fixed_size=False) config.plugins.dreamplex.Entries[i].wol_delay = ConfigInteger(default=60, limits=(1, 180)) printl("=== WOL ===", "__init__::initServerEntryConfig", "D") printl("wol: " + str(config.plugins.dreamplex.Entries[i].wol.value), "__init__::initServerEntryConfig", "D") printl( "wol_mac: " + str(config.plugins.dreamplex.Entries[i].wol_mac.value), "__init__::initServerEntryConfig", "D") printl( "wol_delay: " + str(config.plugins.dreamplex.Entries[i].wol_delay.value), "__init__::initServerEntryConfig", "D") printl("=== SYNC ===", "__init__::initServerEntryConfig", "D") config.plugins.dreamplex.Entries[i].syncMovies = ConfigYesNo(default=True) config.plugins.dreamplex.Entries[i].syncShows = ConfigYesNo(default=True) config.plugins.dreamplex.Entries[i].syncMusic = ConfigYesNo(default=True) printl("", "__init__::initServerEntryConfig", "C") return config.plugins.dreamplex.Entries[i]
class ParentalControlChangePin(Screen, ConfigListScreen, ProtectedScreen): def __init__(self, session, pin, pinname): Screen.__init__(self, session) # for the skin: first try ParentalControlChangePin, then Setup, this allows individual skinning self.skinName = ["ParentalControlChangePin", "Setup"] self.setup_title = _("Change pin code") self.onChangedEntry = [] self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=1111, censor="*") self.pin2 = ConfigPIN(default=1112, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New PIN"), NoSave(self.pin1))) self.list.append( getConfigListEntry(_("Reenter new PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) # print "old pin:", pin #if pin.value != "aaaa": #self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code"))) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap( [ "DirectionActions", "ColorActions", "OkCancelActions", "MenuActions" ], { "cancel": self.keyCancel, "red": self.keyCancel, "save": self.keyOK, "menu": self.closeRecursive, }, -1) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): self.setTitle(self.setup_title) def valueChanged(self, pin, value): if pin == 1: self["config"].setCurrentIndex(1) elif pin == 2: self.keyOK() def getPinText(self): return _("Please enter the old PIN code") def isProtected(self): return (self.pin.value != "aaaa") def protectedWithPin(self): return self.pin.value # def pinEntered(self, result): #if result[0] is None: #self.close() #if not result[0]: #print result, "-", self.pin.value #self.session.openWithCallback(self.close, MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR) def keyOK(self): if self.pin1.value == self.pin2.value: self.pin.value = self.pin1.value self.pin.save() self.session.openWithCallback( self.close, MessageBox, _("The PIN code has been changed successfully."), MessageBox.TYPE_INFO) else: self.session.open(MessageBox, _("The PIN codes you entered are different."), MessageBox.TYPE_ERROR) def keyNumberGlobal(self, number): ConfigListScreen.keyNumberGlobal(self, number) # for summary: def changedEntry(self): for x in self.onChangedEntry: x() def getCurrentEntry(self): return self["config"].getCurrent()[0] def getCurrentValue(self): return str(self["config"].getCurrent()[1].getText()) def createSummary(self): from Screens.Setup import SetupSummary return SetupSummary
class PermanentPinEntry(Screen, ConfigListScreen): def __init__(self, session, pin, pin_slot): Screen.__init__(self, session) self.skinName = ['ParentalControlChangePin', 'Setup'] self.setup_title = _('Enter pin code') self.onChangedEntry = [] self.slot = pin_slot self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=0, censor='*') self.pin2 = ConfigPIN(default=0, censor='*') self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_('Enter PIN'), NoSave(self.pin1))) self.list.append(getConfigListEntry(_('Reenter PIN'), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) self['actions'] = NumberActionMap(['DirectionActions', 'ColorActions', 'OkCancelActions'], {'cancel': self.cancel, 'red': self.cancel, 'save': self.keyOK}, -1) self['key_red'] = StaticText(_('Cancel')) self['key_green'] = StaticText(_('OK')) self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): self.setTitle(self.setup_title) def valueChanged(self, pin, value): if pin == 1: self['config'].setCurrentIndex(1) elif pin == 2: self.keyOK() def keyOK(self): if self.pin1.value == self.pin2.value: self.pin.value = self.pin1.value self.pin.save() self.session.openWithCallback(self.close, MessageBox, _('The PIN code has been saved successfully.'), MessageBox.TYPE_INFO) else: self.session.open(MessageBox, _('The PIN codes you entered are different.'), MessageBox.TYPE_ERROR) def cancel(self): self.close(None) return def keyNumberGlobal(self, number): ConfigListScreen.keyNumberGlobal(self, number) def changedEntry(self): for x in self.onChangedEntry: x() def getCurrentEntry(self): return self['config'].getCurrent()[0] def getCurrentValue(self): return str(self['config'].getCurrent()[1].getText()) def createSummary(self): from Screens.Setup import SetupSummary return SetupSummary
class ParentalControlChangePin(Screen, ConfigListScreen, ProtectedScreen): def __init__(self, session, pin, pinname): Screen.__init__(self, session) # for the skin: first try ParentalControlChangePin, then Setup, this allows individual skinning self.skinName = ["ParentalControlChangePin", "Setup"] self.setup_title = _("Change pin code") self.onChangedEntry = [] self.pin = pin self.list = [] self.pin1 = ConfigPIN(default=1111, censor="*") self.pin2 = ConfigPIN(default=1112, censor="*") self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1)) self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New PIN"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Reenter new PIN"), NoSave(self.pin2))) ConfigListScreen.__init__(self, self.list) # print "old pin:", pin # if pin.value != "aaaa": # self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code"))) ProtectedScreen.__init__(self) self["actions"] = NumberActionMap( ["DirectionActions", "ColorActions", "OkCancelActions"], {"cancel": self.cancel, "red": self.cancel, "save": self.keyOK}, -1, ) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): self.setTitle(self.setup_title) def valueChanged(self, pin, value): if pin == 1: self["config"].setCurrentIndex(1) elif pin == 2: self.keyOK() def getPinText(self): return _("Please enter the old PIN code") def isProtected(self): return self.pin.value != "aaaa" def protectedWithPin(self): return self.pin.value # def pinEntered(self, result): # if result[0] is None: # self.close() # if not result[0]: # print result, "-", self.pin.value # self.session.openWithCallback(self.close, MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR) def keyOK(self): if self.pin1.value == self.pin2.value: self.pin.value = self.pin1.value self.pin.save() self.session.openWithCallback( self.close, MessageBox, _("The PIN code has been changed successfully."), MessageBox.TYPE_INFO ) else: self.session.open(MessageBox, _("The PIN codes you entered are different."), MessageBox.TYPE_ERROR) def cancel(self): self.close(None) def keyNumberGlobal(self, number): ConfigListScreen.keyNumberGlobal(self, number) # for summary: def changedEntry(self): for x in self.onChangedEntry: x() def getCurrentEntry(self): return self["config"].getCurrent()[0] def getCurrentValue(self): return str(self["config"].getCurrent()[1].getText()) def createSummary(self): from Screens.Setup import SetupSummary return SetupSummary