Ejemplo n.º 1
0
	def __init__(self, service):
		self._service = service
		self.onChanged = []
		self.onMethodChanged = []
		method_choices_ip4 = {eNetworkService.METHOD_DHCP : "dhcp", eNetworkService.METHOD_MANUAL : _("manual"), eNetworkService.METHOD_OFF : _("off")}
		#IPv4
		self._config_ip4_method = ConfigSelection(method_choices_ip4, default=eNetworkService.METHOD_DHCP)
		self._config_ip4_address = ConfigIP(default=[0,0,0,0])
		self._config_ip4_mask = ConfigIP(default=[0,0,0,0])
		self._config_ip4_gw = ConfigIP(default=[0,0,0,0])
		#IPv6
		method_choices_ip6 = {eNetworkService.METHOD_AUTO : _("auto"), eNetworkService.METHOD_6TO4 : "6to4", eNetworkService.METHOD_MANUAL : _("manual"), eNetworkService.METHOD_OFF : _("off")}
		choices_privacy_ip6 = {eNetworkService.IPV6_PRIVACY_DISABLED : _("Disabled"), eNetworkService.IPV6_PRIVACY_ENABLED : _("Enabled"), eNetworkService.IPV6_PRIVACY_PREFERRED : _("Preferred")}
		self._config_ip6_method = ConfigSelection(method_choices_ip6, default=eNetworkService.METHOD_DHCP)
		self._config_ip6_address = ConfigIP6()
		self._config_ip6_prefix_length = ConfigInteger(0, limits=(1, 128))
		self._config_ip6_gw = ConfigIP6()
		self._config_ip6_privacy = ConfigSelection(choices_privacy_ip6, default="disabled")

		self._isReloading = False
		self._ipv4Changed = False
		self._ipv6Changed = False
		self._addNotifiers()
		self._service_conn = [
			self._service.ipv4Changed.connect(self._serviceChanged),
			self._service.ipv6Changed.connect(self._serviceChanged),
			self._service.ipv4ConfigChanged.connect(self._serviceChanged),
			self._service.ipv6ConfigChanged.connect(self._serviceChanged),
		]
Ejemplo n.º 2
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)
        print("installwizard starts")
        self.index = args
        self.list = []
        ConfigListScreen.__init__(self, self.list)

        if self.index == self.STATE_UPDATE:
            config.misc.installwizard.hasnetwork.value = False
            config.misc.installwizard.ipkgloaded.value = False
            modes = {0: " "}
            self.enabled = ConfigSelection(choices=modes, default=0)
            self.adapters = [(iNetwork.getFriendlyAdapterName(x), x)
                             for x in iNetwork.getAdapterList()]
            is_found = False
            if os.path.isfile("/tmp/netwizardselection"):
                f = open('/tmp/netwizardselection', 'r')
                adapx1 = f.read()
                f.close()
                adapx1 = adapx1.replace('\n', '')
                print("adapx1:", adapx1)
            else:
                adapx1 = 'eth0'
                print("adapx1+1:", adapx1)
            for x in self.adapters:
                if adapx1 == 'eth0':
                    if iNetwork.getAdapterAttribute(adapx1, 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(adapx1, "ip"))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break
                elif adapx1 == 'wlan0':
                    if iNetwork.getAdapterAttribute(adapx1, 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(adapx1, "ip"))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break
                elif adapx1 == 'ra0':
                    if iNetwork.getAdapterAttribute(adapx1, 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(adapx1, "ip"))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break
            if is_found is False:
                self.createMenu()
        elif self.index == self.STATE_CHOISE_CHANNELLIST:
            self.enabled = ConfigYesNo(default=True)
            modes = {"default": _("OpenNFR List"), "scan": _("scan new")}
            self.channellist_type = ConfigSelection(choices=modes,
                                                    default="default")
            self.createMenu()
	def createConfig(self):

		def set_avahiselect_seperate(configElement):
			if config.usage.remote_fallback_import_url.value and config.usage.remote_fallback_import_url.value != config.usage.remote_fallback.value:
				peerDefault_sepearate = config.usage.remote_fallback_import_url.value
			else:
				peerDefault_sepearate = "same"
				config.usage.remote_fallback_import_url.value = config.usage.remote_fallback.value
			self.seperateBoxes = [("same", _("Same as stream"))] + self.peerStreamingBoxes
			if configElement.value not in ("url", "ip") and configElement.value in self.seperateBoxes:
				self.seperateBoxes.remove(configElement.value)
			self.avahiselect_seperate = ConfigSelection(default=peerDefault_sepearate, choices=self.seperateBoxes)

		self.peerStreamingBoxes = getPeerStreamingBoxes() + [("ip", _("Enter IP address")), ("url", _("Enter URL"))]
		peerDefault = peerDefault_sepearate = None
		if config.usage.remote_fallback.value:
			peerDefault = peerDefault_sepearate = config.usage.remote_fallback.value
			if config.usage.remote_fallback.value and config.usage.remote_fallback.value not in self.peerStreamingBoxes:
				self.peerStreamingBoxes = [config.usage.remote_fallback.value] + self.peerStreamingBoxes
			if config.usage.remote_fallback_import_url.value and config.usage.remote_fallback_import_url.value not in self.peerStreamingBoxes:
				self.peerStreamingBoxes = [config.usage.remote_fallback_import_url.value] + self.peerStreamingBoxes
		self.avahiselect = ConfigSelection(default=peerDefault, choices=self.peerStreamingBoxes)
		self.avahiselect.addNotifier(set_avahiselect_seperate)
		try:
			ipDefault = [int(x) for x in config.usage.remote_fallback.value.split(":")[1][2:].split(".")]
			portDefault = int( config.usage.remote_fallback.value.split(":")[2])
		except:
			ipDefault = [0, 0, 0, 0]
			portDefault = 8001
		self.ip = ConfigIP(default=ipDefault, auto_jump=True)
		self.port = ConfigInteger(default=portDefault, limits=(1,65535))
		self.ip_seperate = ConfigIP( default=ipDefault, auto_jump=True)
		self.port_seperate = ConfigInteger(default=portDefault, limits=(1,65535))
Ejemplo n.º 4
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)

        self.index = args
        self.list = []
        ConfigListScreen.__init__(self, self.list)

        if self.index == self.STATE_UPDATE:
            config.misc.installwizard.hasnetwork.value = False
            config.misc.installwizard.ipkgloaded.value = False
            modes = {0: " "}
            self.enabled = ConfigSelection(choices=modes, default=0)
            self.adapters = [(iNetwork.getFriendlyAdapterName(x), x)
                             for x in iNetwork.getAdapterList()]
            is_found = False
            for x in self.adapters:
                if x[1] == 'eth0':
                    if iNetwork.getAdapterAttribute(x[1], 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(x[1], "ip"))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break
                elif x[1] == 'wlan0':
                    if iNetwork.getAdapterAttribute(x[1], 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(x[1], "ip"))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break
            if is_found is False:
                self.createMenu()
        elif self.index == self.STATE_CHOISE_CHANNELLIST:
            self.enabled = ConfigYesNo(default=True)
            modes = {
                "default-ventonsupport": "Default Germany",
                "henksat-19e": "Astra 1",
                "henksat-23e": "Astra 3",
                "henksat-19e-23e": "Astra 1 Astra 3",
                "henksat-19e-23e-28e": "Astra 1 Astra 2 Astra 3",
                "henksat-13e-19e-23e-28e": "Astra 1 Astra 2 Astra 3 Hotbird"
            }
            self.channellist_type = ConfigSelection(
                choices=modes, default="default-ventonsupport")
            self.createMenu()
        elif self.index == self.STATE_CHOISE_SOFTCAM:
            self.enabled = ConfigYesNo(default=True)
            modes = {"cccam": _("default") + " (CCcam)", "scam": "scam"}
            self.softcam_type = ConfigSelection(choices=modes, default="cccam")
            self.createMenu()
Ejemplo n.º 5
0
    def __init__(self, session, args = None):
        Screen.__init__(self, session)
        self.index = args
        self.list = []
        ConfigListScreen.__init__(self, self.list)
        self.ipConfigEntry = ConfigIP(default=[0,
         0,
         0,
         0])
        self.interface = 'eth0'
        if self.index == self.STATE_UPDATE:
            config.misc.installwizard.hasnetwork.value = False
            config.misc.installwizard.ipkgloaded.value = False
            modes = {0: ' '}
            self.enabled = ConfigSelection(choices=modes, default=0)
            self.adapters = [ (iNetwork.getFriendlyAdapterName(x), x) for x in iNetwork.getAdapterList() ]
            is_found = False
            for x in self.adapters:
                if x[1] == 'eth0':
                    if iNetwork.getAdapterAttribute(x[1], 'up'):
                        self.ipConfigEntry = ConfigIP(default=iNetwork.getAdapterAttribute(x[1], 'ip'))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                        self.interface = x[1]
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break

            if is_found is False:
                self.createMenu()
        elif self.index == self.STATE_CHOISE_CHANNELLIST:
            self.enabled = ConfigYesNo(default=True)
            modes = {'henksat-19e': 'Astra 1',
             'henksat-23e': 'Astra 3',
             'henksat-19e-23e': 'Astra 1 Astra 3',
             'henksat-19e-23e-28e': 'Astra 1 Astra 2 Astra 3',
             'henksat-13e-19e-23e-28e': 'Astra 1 Astra 2 Astra 3 Hotbird'}
            self.channellist_type = ConfigSelection(choices=modes, default='henksat-13e-19e-23e-28e')
            self.createMenu()
        elif self.index == self.STATE_CHOISE_SOFTCAM:
            self.enabled = ConfigYesNo(default=True)
            modes = {'oscam': _('default') + ' OSCam',
             'cccam': 'CCcam',
             'gbox': 'GBox',
             'wicardd': 'Wicardd',
             'mgcamd': 'MGCamd'}
            if getBoxType() in 'vusolo4k':
                modes = {'oscam': _('default') + ' OSCam',
                 'wicardd': 'Wicardd'}
            if getBoxType() in 'wetekplay':
                modes = {'oscam': _('default') + ' OSCam'}
            self.softcam_type = ConfigSelection(choices=modes, default='oscam')
            self.createMenu()
Ejemplo n.º 6
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)
        self.index = args
        self.list = []
        ConfigListScreen.__init__(self, self.list)
        if self.index == self.STATE_UPDATE:
            config.misc.installwizard.hasnetwork.value = False
            config.misc.installwizard.ipkgloaded.value = False
            modes = {0: ' '}
            self.enabled = ConfigSelection(choices=modes, default=0)
            self.adapters = [(iNetwork.getFriendlyAdapterName(x), x)
                             for x in iNetwork.getAdapterList()]
            is_found = False
            for x in self.adapters:
                if x[1] == 'eth0' or x[1] == 'eth1':
                    if iNetwork.getAdapterAttribute(x[1], 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(x[1], 'ip'))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break

            if is_found is False:
                self.createMenu()
        elif self.index == self.STATE_CHOISE_CHANNELLIST:
            self.enabled = ConfigYesNo(default=True)
            modes = {
                'default': _('default Astra (13e-19e)'),
                'scan': _('scan new')
            }
            self.channellist_type = ConfigSelection(choices=modes,
                                                    default='default')
            self.createMenu()
Ejemplo n.º 7
0
def initPartnerboxEntryConfig():
    config.plugins.Partnerbox.Entries.append(ConfigSubsection())
    i = len(config.plugins.Partnerbox.Entries) - 1
    config.plugins.Partnerbox.Entries[i].name = ConfigText(
        default="Remote box", visible_width=50, fixed_size=False)
    config.plugins.Partnerbox.Entries[i].ip = ConfigIP(
        default=[192, 168, 0, 98])
    config.plugins.Partnerbox.Entries[i].port = ConfigInteger(default=80,
                                                              limits=(1,
                                                                      65555))
    config.plugins.Partnerbox.Entries[i].enigma = ConfigSelection(
        default="0", choices=[("0", _("Enigma 2")), ("1", _("Enigma 1"))])
    config.plugins.Partnerbox.Entries[i].type = ConfigSelection(
        default="4114", choices=[("4114", "4114"), ("4097", "4097")])
    config.plugins.Partnerbox.Entries[i].password = ConfigText(
        default="root", visible_width=50, fixed_size=False)
    config.plugins.Partnerbox.Entries[i].usewakeonlan = ConfigYesNo(
        default=False)
    config.plugins.Partnerbox.Entries[i].mac = ConfigText(
        default="00:00:00:00:00:00", fixed_size=False)
    config.plugins.Partnerbox.Entries[i].useinternal = ConfigSelection(
        default="1",
        choices=[("0", _("use external")), ("1", _("use internal"))])
    config.plugins.Partnerbox.Entries[
        i].zaptoservicewhenstreaming = ConfigYesNo(default=False)
    return config.plugins.Partnerbox.Entries[i]
Ejemplo n.º 8
0
 def LoadConfig(self):
     try:
         try:
             xf = open(DirConfig, "r")
             f = xf.readlines()
             xf.close()
         except Exception, e:
             return
         for line in f:
             LoadConf = line.strip()
             if LoadConf.find('AddressIp') != -1:
                 Addres = str(LoadConf.split('AddressIp')[1].strip())
                 Ip0 = int(Addres.split('.')[0])
                 Ip1 = int(Addres.split('.')[1])
                 Ip2 = int(Addres.split('.')[2])
                 Ip3 = int(Addres.split('.')[3])
                 self.SelectIp = NoSave(
                     ConfigIP(default=[Ip0, Ip1, Ip2, Ip3]))
             elif LoadConf.find('SelectUrl') != -1:
                 self.SelectUrl.setValue(
                     int(str(LoadConf.split('SelectUrl')[1].strip())))
             elif LoadConf.find('Port') != -1:
                 self.TransPort.setValue(
                     int(str(LoadConf.split('Port')[1].strip())))
             elif LoadConf.find('Refresh') != -1:
                 self.Timer.setValue(
                     int(str(LoadConf.split('Refresh')[1].strip())))
             elif LoadConf.find('ConnectionType') != -1:
                 self.SelectConf.setValue(
                     str(LoadConf.split('ConnectionType')[1].strip()))
Ejemplo n.º 9
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.session = session

        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("Scan NFS share"))
        self["key_yellow"] = StaticText(_("Scan range"))
        self["summary_description"] = StaticText("")

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions"], {
                "back": self.exit,
                "red": self.exit,
                "cancel": self.exit,
                "green": self.goNfs,
                "yellow": self.goAddress,
            }, -1)

        self.ipAddress = ConfigIP(default=[0, 0, 0, 0])

        ConfigListScreen.__init__(self, [
            getConfigListEntry(_("IP Address"), self.ipAddress),
        ], self.session)

        self.onLayoutFinish.append(self.layoutFinished)
Ejemplo n.º 10
0
    def initialize_entry(self, setting, entry):
        # fix dotted id
        entry['id'] = entry['id'].replace('.', '_')

        if entry['type'] == 'bool':
            setattr(setting, entry['id'], ConfigYesNo(default=(entry['default'] == 'true')))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'text':
            if entry['option'] == 'true':
                setattr(setting, entry['id'], ConfigPassword(default=entry['default'], fixed_size=False))
            else:
                setattr(setting, entry['id'], ConfigText(default=entry['default'], fixed_size=False))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'enum':
            choicelist = [(str(idx), self._get_label(e).encode('utf-8')) for idx, e in enumerate(entry['lvalues'].split("|"))]
            setattr(setting, entry['id'], ConfigSelection(default=entry['default'], choices=choicelist))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'labelenum':
            choicelist = [(self._get_label(e).encode('utf-8'), self._get_label(e).encode('utf-8')) for e in entry['values'].split("|")]
            setattr(setting, entry['id'], ConfigSelection(default=entry['default'], choices=choicelist))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'ipaddress':
            setattr(setting, entry['id'], ConfigIP(default=map(int, entry['default'].split('.')), auto_jump=True))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'number':
            setattr(setting, entry['id'], ConfigNumber(default=int(entry['default'])))
            entry['setting_id'] = getattr(setting, entry['id'])
        else:
            log.error('%s cannot initialize unknown entry %s', self, entry['type'])
Ejemplo n.º 11
0
def initPartnerboxEntryConfig():
    config.plugins.Partnerbox.Entries.append(ConfigSubsection())
    i = len(config.plugins.Partnerbox.Entries) - 1
    config.plugins.Partnerbox.Entries[i].name = ConfigText(default="dreambox",
                                                           visible_width=50,
                                                           fixed_size=False)
    config.plugins.Partnerbox.Entries[i].ip = ConfigIP(
        default=[192, 168, 0, 98])
    config.plugins.Partnerbox.Entries[i].port = ConfigInteger(default=80,
                                                              limits=(1,
                                                                      65555))
    config.plugins.Partnerbox.Entries[i].password = ConfigText(
        default="dreambox", visible_width=50, fixed_size=False)
    config.plugins.Partnerbox.Entries[i].useinternal = ConfigSelection(
        default="1",
        choices=[("0", _("use external")), ("1", _("use internal"))])
    config.plugins.Partnerbox.Entries[
        i].zaptoservicewhenstreaming = ConfigYesNo(default=True)
    config.plugins.Partnerbox.Entries[i].webinterfacetype = ConfigSelection(
        default="standard",
        choices=[("standard", _("Standard")),
                 ("openwebif", _("Old Webinterface/OpenWebif"))])
    config.plugins.Partnerbox.Entries[i].canRecord = ConfigYesNo(default=False)
    config.plugins.Partnerbox.Entries[i].transcoding = ConfigSelection(
        default="no",
        choices=[("no", _("No")), ("rtsp", "RTSP"), ("hls", "HLS"),
                 ("custom", _("Custom"))])
    config.plugins.Partnerbox.Entries[i].customStreamUrl = ConfigText(
        default="", visible_width=15, fixed_size=False)
    return config.plugins.Partnerbox.Entries[i]
	def __init__(self, session, args = None):
		Screen.__init__(self, session)

		self.index = args
		self.list = []
		ConfigListScreen.__init__(self, self.list)

		if self.index is self.STATE_UPDATE:
			config.misc.installwizard.hasnetwork.value = False
			config.misc.installwizard.ipkgloaded.value = False
			modes = {0: " "}
			self.enabled = ConfigSelection(choices = modes, default = 0)
			self.adapters = [(iNetwork.getFriendlyAdapterName(x),x) for x in iNetwork.getAdapterList()]
			is_found = False
			for x in self.adapters:
				if x[1] == 'eth0':
					if iNetwork.getAdapterAttribute(x[1], 'up'):
						self.ipConfigEntry = ConfigIP(default = iNetwork.getAdapterAttribute(x[1], "ip"))
						iNetwork.checkNetworkState(self.checkNetworkCB)
						if_found = True
					else:
						iNetwork.restartNetwork(self.checkNetworkLinkCB)
					break
			if is_found is False:
				self.createMenu()
		elif self.index is self.STATE_CHOISE_CHANNELLIST:
			self.enabled = ConfigYesNo(default = True)
			modes = {"19e-23e-basis": "Astra1 Astra3 basis", "19e-23e": "Astra 1 Astra 3", "19e-23e-28e": "Astra 1 Astra 2 Astra 3", "13e-19e-23e-28e": "Astra 1 Astra 2 Astra 3 Hotbird", "kabelnl": "Kabel-NL"}
			self.channellist_type = ConfigSelection(choices = modes, default = "19e-23e-basis")
			self.createMenu()
		elif self.index is self.STATE_CHOISE_SOFTCAM:
			self.enabled = ConfigYesNo(default = True)
			modes = {"wicardd": _("default") + " (Wicard)", "oscam-ymod": "Oscam-Ymod", "mgcamd": "Mgcamd", "cccam": "Cccam"}
			self.softcam_type = ConfigSelection(choices = modes, default = "wicardd")
			self.createMenu()
Ejemplo n.º 13
0
 def __init__(self, session, entry, index):
     self.skin = OscamServerEntryConfigScreen.skin
     self.session = session
     Screen.__init__(self, session)
     if entry == None:
         entry = oscamServer()
     self.index = index
     serverIP = self.isIPaddress(entry.serverIP)
     if serverIP and config.plugins.OscamStatus.useIP.value:
         self.isIP = True
     else:
         self.isIP = False
     serverPort = int(entry.serverPort)
     self.serverNameConfigEntry = NoSave(ConfigText(default=entry.serverName, fixed_size=False, visible_width=20))
     if self.isIP:
         self.serverIPConfigEntry = NoSave(ConfigIP(default=serverIP, auto_jump=True))
     else:
         self.serverIPConfigEntry = NoSave(ConfigText(default=entry.serverIP, fixed_size=False, visible_width=20))
         self.serverIPConfigEntry.setUseableChars(u'1234567890aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ.-_')
     self.portConfigEntry = NoSave(ConfigInteger(default=serverPort, limits=(0, 65536)))
     self.usernameConfigEntry = NoSave(ConfigText(default=entry.username, fixed_size=False, visible_width=20))
     self.passwordConfigEntry = NoSave(ConfigPassword(default=entry.password, fixed_size=False))
     self.useSSLConfigEntry = NoSave(ConfigYesNo(entry.useSSL))
     ConfigListScreen.__init__(self, [], session=session)
     self.createSetup()
     self['title'] = StaticText(_('Oscam Server Setup'))
     self['ButtonRedtext'] = StaticText(_('return'))
     self['ButtonGreentext'] = StaticText(_('save'))
     self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'red': self.Close,
      'green': self.Save,
      'cancel': self.Close}, -1)
     self.onLayoutFinish.append(self.LayoutFinished)
     return
Ejemplo n.º 14
0
def initFallbackReceiverConfig():
    config.plugins.fallback.receivers.append(ConfigSubsection())
    i = len(config.plugins.fallback.receivers) - 1
    config.plugins.fallback.receivers[i].name = ConfigText(
        default=_("Remote receiver"), visible_width=30, fixed_size=False)
    config.plugins.fallback.receivers[i].ip = ConfigIP(
        default=[192, 168, 1, 100])
    return config.plugins.fallback.receivers[i]
Ejemplo n.º 15
0
	def createConfig(self):
		self.sharenameEntry = None
		self.mounttypeEntry = None
		self.activeEntry = None
		self.ipEntry = None
		self.sharedirEntry = None
		self.optionsEntry = None
		self.usernameEntry = None
		self.passwordEntry = None
		self.hdd_replacementEntry = None
		self.sharetypelist = [("nfs", _("NFS share")), ("cifs", _("CIFS share"))]

		mounttype = self.mountinfo.get('mounttype')
		if not mounttype:
			mounttype = "nfs"
		active = self.mountinfo.get('active', 'True') == 'True'
		if self.mountinfo.has_key('ip'):
			if self.mountinfo['ip'] is False:
				ip = [192, 168, 0, 0]
			else:
				ip = self.convertIP(self.mountinfo['ip'])
		else:
			ip = [192, 168, 0, 0]
		sharename = self.mountinfo.get('sharename', "Sharename")
		sharedir = self.mountinfo.get('sharedir', "/media/hdd")
		username = self.mountinfo.get('username', "")
		password = self.mountinfo.get('password', "")
		hdd_replacement = self.mountinfo.get('hdd_replacement', False)
		if hdd_replacement == 'True':
			hdd_replacement = True
		else:
			hdd_replacement = False
		if sharename is False:
			sharename = "Sharename"
		if sharedir is False:
			sharedir = "/media/hdd"
		if mounttype == "nfs":
			defaultOptions = "rw,nolock,soft"
		else:
			defaultOptions = "rw"
		if username is False:
			username = ""
		if password is False:
			password = ""
		options = self.mountinfo.get('options', defaultOptions)

		self.activeConfigEntry = NoSave(ConfigEnableDisable(default = active))
		self.ipConfigEntry = NoSave(ConfigIP(default = ip))
		self.sharenameConfigEntry = NoSave(ConfigText(default = sharename, visible_width = 50, fixed_size = False))
		self.sharedirConfigEntry = NoSave(ConfigText(default = sharedir, visible_width = 50, fixed_size = False))
		self.optionsConfigEntry = NoSave(ConfigText(default = defaultOptions, visible_width = 50, fixed_size = False))
		if options is not False:
			self.optionsConfigEntry.value = options
		self.usernameConfigEntry = NoSave(ConfigText(default = username, visible_width = 50, fixed_size = False))
		self.passwordConfigEntry = NoSave(ConfigPassword(default = password, visible_width = 50, fixed_size = False))
		self.mounttypeConfigEntry = NoSave(ConfigSelection(self.sharetypelist, default = mounttype ))
		self.hdd_replacementConfigEntry = NoSave(ConfigYesNo(default = hdd_replacement))
Ejemplo n.º 16
0
 def Config(self):
     self.SelectConf = NoSave(
         ConfigSelection([("1", _("Url")), ("0", _("Ip"))], default="1"))
     self.SelectUrl = NoSave(
         ConfigText(default="www.google.com", fixed_size=False))
     self.SelectIp = NoSave(
         ConfigIP(default=[192, 168, 1, 1]) or [0, 0, 0, 0])
     self.TransPort = NoSave(
         ConfigInteger(default=80, limits=(00000, 65535)))
     self.Timer = NoSave(ConfigInteger(default=120, limits=(1, 999)))
Ejemplo n.º 17
0
 def reload(self):
     self._nameservers = []
     ns = self._service.nameserversConfig()
     for n in ns:
         ip = IPAddress(n)
         if ip.version == 4:
             cfg = ConfigIP(default=toIP4List(ip.format()))
             self._nameservers.append(cfg)
         elif ip.version == 6:
             cfg = ConfigIP6(default=ip.format())
             self._nameservers.append(cfg)
Ejemplo n.º 18
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)

        self.index = args
        self.list = []
        self.doNextStep = False
        ConfigListScreen.__init__(self, self.list)

        if self.index == self.STATE_UPDATE:
            config.misc.installwizard.hasnetwork.value = False
            config.misc.installwizard.ipkgloaded.value = False
            modes = {0: " "}
            self.enabled = ConfigSelection(choices=modes, default=0)
            self.adapters = [(iNetwork.getFriendlyAdapterName(x), x)
                             for x in iNetwork.getAdapterList()]
            is_found = False
            for x in self.adapters:
                if x[1] == 'eth0' or x[1] == 'eth1':
                    if iNetwork.getAdapterAttribute(x[1], 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(x[1], "ip"))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break
            if is_found is False:
                self.createMenu()
        elif self.index == self.STATE_CHOISE_CHANNELLIST:
            self.enabled = ConfigYesNo(default=True)
            modes = {
                "19e-23e-basis": "Astra1 Astra3 basis",
                "19e-23e": "Astra 1 Astra 3",
                "19e-23e-28e": "Astra 1 Astra 2 Astra 3",
                "13e-19e-23e-28e": "Astra 1 Astra 2 Astra 3 Hotbird",
                "kabelnl": "Kabel-NL"
            }
            self.channellist_type = ConfigSelection(choices=modes,
                                                    default="19e-23e-basis")
            self.createMenu()
        elif self.index == self.INSTALL_PLUGINS:
            self.noplugins = ConfigNothing()
            self.doplugins = ConfigNothing()
            self.createMenu()
        elif self.index == self.SCAN:
            self.noscan = ConfigNothing()
            self.autoscan = ConfigNothing()
            self.manualscan = ConfigNothing()
            self.fastscan = ConfigNothing()
            self.cablescan = ConfigNothing()
            self.createMenu()
Ejemplo n.º 19
0
    def __init__(self, session, plugin_path, config_filename):
        self._config_saver = ConfigSaver("{}/{}".format(
            plugin_path, config_filename))
        self._connection_configuration = self._config_saver.get_connection_configuration(
        )
        self._session = session
        Screen.__init__(self, self._session)
        self._list = []
        self.__ipadress_config_list_entry = ConfigIP(
            default=self._connection_configuration.ipaddress.split('.'))
        self.__port_config_list_entry = ConfigInteger(
            default=self._connection_configuration.port, limits=(0, 65535))
        self.__username_config_list_entry = ConfigText(
            default=self._connection_configuration.username,
            fixed_size=False,
            visible_width=False
        )  #fixed_size -> input length is length of default, visible_width only one charactar visible
        self.__password_config_list_entry = ConfigPassword(
            default=self._connection_configuration.password,
            fixed_size=False,
            visible_width=False,
            censor="*")

        self._list.append(
            getConfigListEntry(_("IP address"),
                               self.__ipadress_config_list_entry))
        self._list.append(
            getConfigListEntry(_("Port"), self.__port_config_list_entry))
        self._list.append(
            getConfigListEntry(_("Username"),
                               self.__username_config_list_entry))
        self._list.append(
            getConfigListEntry(_("Password"),
                               self.__password_config_list_entry))

        ConfigListScreen.__init__(self, self._list)
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("OK"))

        self["setupActions"] = ActionMap(
            ["SetupActions"], {
                "save": self.save,
                "red": self.cancel,
                "cancel": self.cancel,
                "ok": self.save
            }, -2)

        self.onLayoutFinish.append(self.layoutFinished)
Ejemplo n.º 20
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.session = session
     self['key_red'] = StaticText(_('Cancel'))
     self['key_green'] = StaticText(_('Scan NFS share'))
     self['key_yellow'] = StaticText(_('Scan range'))
     self['actions'] = ActionMap(['SetupActions', 'ColorActions'], {'back': self.exit,
      'red': self.exit,
      'cancel': self.exit,
      'green': self.goNfs,
      'yellow': self.goAddress}, -1)
     self.ipAddress = ConfigIP(default=[0,
      0,
      0,
      0])
     ConfigListScreen.__init__(self, [getConfigListEntry(_('IP Address'), self.ipAddress)], self.session)
     self.onLayoutFinish.append(self.layoutFinished)
Ejemplo n.º 21
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)

        self.index = args
        self.list = []
        ConfigListScreen.__init__(self, self.list)

        if self.index == self.STATE_UPDATE:
            config.misc.installwizard.hasnetwork.value = False
            config.misc.installwizard.ipkgloaded.value = False
            modes = {0: " "}
            self.enabled = ConfigSelection(choices=modes, default=0)
            self.adapters = [(iNetwork.getFriendlyAdapterName(x), x)
                             for x in iNetwork.getAdapterList()]
            is_found = False
            for x in self.adapters:
                if x[1] == 'eth0' or x[1] == 'eth1':
                    if iNetwork.getAdapterAttribute(x[1], 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(x[1], "ip"))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break
            if is_found is False:
                self.createMenu()
        elif self.index == self.STATE_CHOICE_CHANNELLIST:
            self.enabled = ConfigYesNo(default=True, graphic=False)
            modes = {
                "19e": "Astra 19.2e",
                "19e-13e": "Astra 19.2e Hotbird 13.0e",
                "kabel-bw": "Kabel BW",
                "kabeldeutschland": " Kabel Deutschland",
                "unity-media": "Kabel Unitymedia"
            }
            self.channellist_type = ConfigSelection(choices=modes,
                                                    default="19e-13e")
            self.createMenu()
#		elif self.index == self.STATE_CHOICE_SOFTCAM:
#			self.enabled = ConfigYesNo(default = False)
#			self.createMenu()
        elif self.index == self.INSTALL_PLUGINS:
            self.enabled = ConfigYesNo(default=True)
            self.createMenu()
Ejemplo n.º 22
0
    def createConfig(self):
        self.enabled = ConfigYesNo(
            default=config.usage.remote_fallback_enabled.value)
        self.domain = ConfigText(default=config.usage.remote_fallback.value,
                                 fixed_size=False)
        peerStreamingBoxes = getPeerStreamingBoxes()
        self.peerExist = len(peerStreamingBoxes) != 0
        peerDefault = None
        self.peer = None
        if self.peerExist:
            if config.usage.remote_fallback.value in peerStreamingBoxes:
                peerDefault = config.usage.remote_fallback.value
            self.peer = ConfigSelection(default=peerDefault,
                                        choices=[(x, x)
                                                 for x in peerStreamingBoxes])

        ipDefault = [0, 0, 0, 0]
        self.portDefault = portDefault = 8001
        if config.usage.remote_fallback.value:
            result = re.search("(\d+)[.](\d+)[.](\d+)[.](\d+)",
                               config.usage.remote_fallback.value)
            if result is not None:
                ipDefault = [
                    int(result.group(1)),
                    int(result.group(2)),
                    int(result.group(3)),
                    int(result.group(4))
                ]
            result = re.search("[:](\d+)$", config.usage.remote_fallback.value)
            if result is not None:
                portDefault = int(result.group(1))
        self.ip = ConfigIP(default=ipDefault, auto_jump=True)

        self.port = ConfigInteger(default=portDefault, limits=(1, 65535))

        fallbackAddressChoices = [("ip", _("IP")), ("domain", _("URL"))]
        if self.peerExist:
            fallbackAddressChoices.append(("peer", _("Network peer")))
        fallbackAddressTypeDefault = "domain"
        if peerDefault or self.peerExist and self.domain.value == "":
            fallbackAddressTypeDefault = "peer"
        if ipDefault != [0, 0, 0, 0]:
            fallbackAddressTypeDefault = "ip"
        self.fallbackAddressType = ConfigSelection(
            default=fallbackAddressTypeDefault, choices=fallbackAddressChoices)
Ejemplo n.º 23
0
def InitClientMode():
    config.clientmode = ConfigSubsection()
    config.clientmode.enabled = ConfigYesNo(default=False)

    def clientModeChanged(configElement):
        SystemInfo["ClientModeEnabled"] = configElement.value == True
        SystemInfo["ClientModeDisabled"] = configElement.value != True

    config.clientmode.enabled.addNotifier(clientModeChanged,
                                          immediate_feedback=True,
                                          initial_call=True)
    config.clientmode.serverAddressType = ConfigSelection(default="ip",
                                                          choices=[
                                                              ("ip", _("IP")),
                                                              ("domain",
                                                               _("Domain"))
                                                          ])
    config.clientmode.serverIP = ConfigIP(default=[0, 0, 0, 0], auto_jump=True)
    config.clientmode.serverDomain = ConfigText(default="", fixed_size=False)
    config.clientmode.serverStreamingPort = ConfigInteger(default=8001,
                                                          limits=(1, 65535))
    config.clientmode.serverFTPusername = ConfigText(default="root",
                                                     fixed_size=False)
    config.clientmode.serverFTPpassword = ConfigText(default="",
                                                     fixed_size=False)
    config.clientmode.serverFTPPort = ConfigInteger(default=21,
                                                    limits=(1, 65535))
    config.clientmode.passive = ConfigYesNo(False)
    config.clientmode.enableSchedule = ConfigYesNo(False)
    config.clientmode.scheduleRepeatInterval = ConfigSelection(
        default="360",
        choices=[("60", _("Every hour")), ("120", _("Every 2 hours")),
                 ("180", _("Every 3 hours")), ("360", _("Every 6 hours")),
                 ("720", _("Every 12 hours")), ("daily", _("Daily"))])
    config.clientmode.scheduletime = ConfigClock(default=0)  # 1:00
    # to reinstate normal mode settings
    config.clientmode.nim_cache = ConfigText(default="", fixed_size=False)
    config.clientmode.remote_fallback_enabled_cache = ConfigYesNo(
        default=False)
    config.clientmode.remote_fallback_cache = ConfigText(default="",
                                                         fixed_size=False)
    print("[ClientMode] Client mode data initialised.")
Ejemplo n.º 24
0
	def createConfig(self):
		self.enabled = ConfigYesNo(default = config.usage.remote_fallback_enabled.value)
		self.domain = ConfigText(default = config.usage.remote_fallback.value, fixed_size = False)
		peerStreamingBoxes = getPeerStreamingBoxes()
		self.peerExist = len(peerStreamingBoxes) != 0
		peerDefault = None
		self.peer = None
		if self.peerExist:
			if config.usage.remote_fallback.value in peerStreamingBoxes:
				peerDefault = config.usage.remote_fallback.value
			self.peer = ConfigSelection(default = peerDefault, choices = [(x,x) for x in peerStreamingBoxes])

		ipDefault = [0,0,0,0]
		self.portDefault = portDefault = 8001
		if config.usage.remote_fallback.value:
			result = re.search("(\d+)[.](\d+)[.](\d+)[.](\d+)", config.usage.remote_fallback.value)
			if result is not None:
				ipDefault = [int(result.group(1)),int(result.group(2)),int(result.group(3)),int(result.group(4))]
			result = re.search("[:](\d+)$", config.usage.remote_fallback.value)
			if result is not None:
				portDefault = int(result.group(1))
		self.ip = ConfigIP( default = ipDefault, auto_jump=True)

		self.port = ConfigInteger(default = portDefault, limits=(1,65535))

		fallbackAddressChoices = [("ip", _("IP")), ("domain", _("URL"))]
		if self.peerExist:
			fallbackAddressChoices.append(("peer", _("Network peer")))
		fallbackAddressTypeDefault = "domain"
		if peerDefault or self.peerExist and self.domain.value == "":
			fallbackAddressTypeDefault = "peer"
		if ipDefault != [0,0,0,0]:
			fallbackAddressTypeDefault = "ip"
		self.fallbackAddressType = ConfigSelection(default = fallbackAddressTypeDefault, choices = fallbackAddressChoices)

		self.enabledEntry = getConfigListEntry(_("Enable fallback remote receiver"), self.enabled,_('Enable usage of tuners from another Enigma2 receiver on the local network. Remote tuners will be used when tuners are not available on this receiver. (No free tuner or service type is not available.)'))
		self.addressTypeEntry = getConfigListEntry(_("Fallback address type"), self.fallbackAddressType,_("'Network peer' automatically detects other Enigma2 receivers on the local network. You can also manually enter the URL or IP address."))
		self.peerEntry = self.peer and getConfigListEntry(_("Network peers"), self.peer,_("Select a receiver to use for fallback tuners. If the host receiver is not listed, manually enter the URL or IP address"))
		self.ipEntry = getConfigListEntry(_("Fallback receiver IP address"), self.ip,_("Enter the IP address of the receiver to use for fallback tuners."))
		self.domainEntry = getConfigListEntry(_("Fallback remote receiver URL"), self.domain,_("Enter the URL/IP of the fallback remote receiver, e.g. '192.168.0.1'. The other details such as 'http://' and port number will be filled in automatically when you select save."))
		self.portEntry = getConfigListEntry(_("Fallback receiver streaming port"), self.port,_("Default port is '%d'. Change if required.") % self.portDefault)
Ejemplo n.º 25
0
def initServerEntryConfig():
    '''
	'''
    printl("", "__init__::initServerEntryConfig", "S")

    config.plugins.dreamplex.Entries.append(ConfigSubsection())
    i = len(config.plugins.dreamplex.Entries) - 1
    config.plugins.dreamplex.Entries[i].state = ConfigYesNo(default=True)
    config.plugins.dreamplex.Entries[i].connectionType = ConfigSelection(
        default="0", choices=[("0", _("wan")), ("1", _("lan"))])
    config.plugins.dreamplex.Entries[i].name = ConfigText(default="PlexServer",
                                                          visible_width=50,
                                                          fixed_size=False)
    config.plugins.dreamplex.Entries[i].ip = ConfigIP(default=[192, 168, 0, 1])
    config.plugins.dreamplex.Entries[i].port = ConfigInteger(default=32400,
                                                             limits=(1, 65555))
    config.plugins.dreamplex.Entries[i].transcode = ConfigYesNo(default=True)
    config.plugins.dreamplex.Entries[i].transcodeType = ConfigSelection(
        default="0", choices=[("0", _("m3u8")), ("1", _("flv"))])
    config.plugins.dreamplex.Entries[i].quality = ConfigSelection(
        default="0",
        choices=[("0", _("240p")), ("1", _("320p")), ("2", _("480p")),
                 ("3", _("720p")), ("4", _("1080p"))])
    config.plugins.dreamplex.Entries[i].audioOutput = ConfigSelection(
        default="2",
        choices=[("0", _("mp3,aac")), ("1", _("mp3,aac,ac3")),
                 ("2", _("mp3,aac,ac3,dts"))])
    config.plugins.dreamplex.Entries[i].streamMode = ConfigSelection(
        default="0",
        choices=[("0", _("HTTP Streaming")), ("1", _("Local Buffer Mode")),
                 ("2", _("Direct Play"))])
    config.plugins.dreamplex.Entries[i].wol = ConfigYesNo(default=False)
    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))

    return config.plugins.dreamplex.Entries[i]

    printl("", "__init__::initServerEntryConfig", "C")
Ejemplo n.º 26
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)

        self.index = args
        self.list = []
        ConfigListScreen.__init__(self, self.list)

        if self.index == self.STATE_UPDATE:
            config.misc.installwizard.hasnetwork.setValue(False)
            config.misc.installwizard.ipkgloaded.setValue(False)
            modes = {0: " "}
            self.enabled = ConfigSelection(choices=modes, default=0)
            self.adapters = [(iNetwork.getFriendlyAdapterName(x), x)
                             for x in iNetwork.getAdapterList()]
            is_found = False
            for x in self.adapters:
                if x[1] == 'eth0':
                    if iNetwork.getAdapterAttribute(x[1], 'up'):
                        self.ipConfigEntry = ConfigIP(
                            default=iNetwork.getAdapterAttribute(x[1], "ip"))
                        iNetwork.checkNetworkState(self.checkNetworkCB)
                        if_found = True
                    else:
                        iNetwork.restartNetwork(self.checkNetworkLinkCB)
                    break
            if is_found is False:
                self.createMenu()
        elif self.index == self.STATE_CHOISE_CHANNELLIST:
            self.enabled = ConfigYesNo(default=True)
            modes = {
                "AAF": "AAF default(13e-19e)",
                "19e": "Astra 1",
                "23e": "Astra 3",
                "19e-23e": "Astra 1 Astra 3",
                "19e-23e-28e": "Astra 1 Astra 2 Astra 3",
                "13e-19e-23e-28e": "Astra 1 Astra 2 Astra 3 Hotbird"
            }
            self.channellist_type = ConfigSelection(choices=modes,
                                                    default="AAF")
            self.createMenu()
Ejemplo n.º 27
0
    def createConfig(self):
        self.sharetypelist = []
        self.sharetypelist.append(("nfs", _("NFS share")))
        self.sharetypelist.append(("cifs", _("CIFS share")))

        mounttype = self.mountinfo['mounttype']
        active = self.mountinfo['active']
        ip = self.convertIP(self.mountinfo['ip'])
        sharename = self.mountinfo['sharename']
        sharedir = self.mountinfo['sharedir']
        options = self.mountinfo['options']
        username = self.mountinfo['username']
        password = self.mountinfo['password']
        hdd_replacement = self.mountinfo['hdd_replacement']
        if mounttype == "nfs":
            defaultOptions = iAutoMount.DEFAULT_OPTIONS_NFS['options']
        else:
            defaultOptions = iAutoMount.DEFAULT_OPTIONS_CIFS['options']

        self._cfgActive = NoSave(ConfigOnOff(default=active))
        self._cfgIp = NoSave(ConfigIP(default=ip))
        self._cfgSharename = NoSave(
            ConfigText(default=sharename, visible_width=50, fixed_size=False))
        self._cfgSharedir = NoSave(
            ConfigText(default=sharedir, visible_width=50, fixed_size=False))
        self._cfgOptions = NoSave(
            ConfigText(default=defaultOptions,
                       visible_width=50,
                       fixed_size=False))
        if options is not False:
            self._cfgOptions.value = options
        self._cfgUsername = NoSave(
            ConfigText(default=username, visible_width=50, fixed_size=False))
        self._cfgPassword = NoSave(
            ConfigPassword(default=password,
                           visible_width=50,
                           fixed_size=False))
        self._cfgMounttype = NoSave(
            ConfigSelection(self.sharetypelist, default=mounttype))
        self._cfgHddReplacement = NoSave(ConfigYesNo(default=hdd_replacement))
Ejemplo n.º 28
0
    def createMenu(self):
        self.list = []
        try:
            test = self.index
        except:
            return

        if self.index == self.STATE_UPDATE:
            if config.misc.installwizard.hasnetwork.value:
                self.ipConfigEntry = ConfigIP(default=iNetwork.getAdapterAttribute(self.interface, 'ip'))
                self.list.append(getConfigListEntry(_('Your internet connection is working (ip: %s)') % self.ipConfigEntry.getText(), self.enabled))
            else:
                self.list.append(getConfigListEntry(_('Your receiver does not have an internet connection'), self.enabled))
        elif self.index == self.STATE_CHOISE_CHANNELLIST:
            self.list.append(getConfigListEntry(_('Install channel list'), self.enabled))
            if self.enabled.value:
                self.list.append(getConfigListEntry(_('Channel list type'), self.channellist_type))
        elif self.index == self.STATE_CHOISE_SOFTCAM:
            self.list.append(getConfigListEntry(_('Install softcam'), self.enabled))
            if self.enabled.value:
                self.list.append(getConfigListEntry(_('Softcam type'), self.softcam_type))
        self['config'].list = self.list
        self['config'].l.setList(self.list)
Ejemplo n.º 29
0
    def __init__(self, session, exportDir, client, options):
        self.skin = editExportEntry.skin
        self.session = session
        Screen.__init__(self, session)

        nfsoptions = [\
        "ro,sync",
        "rw,sync",
        "ro,async",
        "rw,async",
        "ro,no_root_squash",
        "rw,no_root_squash",
        "ro,no_subtree_check",
        "rw,no_subtree_check",
        "ro,insecure",
        "rw,insecure",
        "ro,insecure,no_subtree_check",
        "rw,insecure,no_subtree_check",
        "ro,sync,no_subtree_check",
        "rw,sync,no_subtree_check",
        "ro,async,no_subtree_check",
        "rw,async,no_subtree_check",
        "ro,no_root_squash,no_subtree_check",
        "rw,no_root_squash,no_subtree_check",
        "ro,no_root_squash,sync",
        "rw,no_root_squash,sync",
        "ro,no_root_squash,sync,no_subtree_check",
        "rw,no_root_squash,sync,no_subtree_check",
        "ro,no_root_squash,async",
        "rw,no_root_squash,async",
        "ro,no_root_squash,async,no_subtree_check",
        "rw,no_root_squash,async,no_subtree_check"]

        optionsEntrys = {}
        for x in nfsoptions:
            optionsEntrys[x] = x

        clientIP = [192, 168, 0, 0]
        self.netmask = ''

        tmp = client.split('/')
        if len(tmp) > 1:
            client = tmp[0]
            self.netmask = tmp[1]

        if client == '*':
            everyIP = True
        else:
            everyIP = False
            theIP = client.split('.')
            clientIP = []
            for x in theIP:
                clientIP.append(int(x))

        self.exportDirConfigEntry = NoSave(ConfigDirectory(exportDir))
        self.everyIPConfigEntry = NoSave(ConfigEnableDisable(default=everyIP))
        self.clientConfigEntry = NoSave(ConfigIP(clientIP))
        self.optionsConfigEntry = NoSave(
            ConfigSelection(optionsEntrys, options))

        ConfigListScreen.__init__(self, [])
        self.createSetup()
        self.everyIPConfigEntry.addNotifier(self.toggleEveryIP)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "cancel": self.cancel,
                "red": self.cancel,
                "green": self.green,
                "ok": self.ok
            }, -2)

        self["ButtonGreen"] = Pixmap()
        self["ButtonGreentext"] = Label(_("Save and Close"))
        self["ButtonRed"] = Pixmap()
        self["ButtonRedtext"] = Label(_("Close"))
Ejemplo n.º 30
0
                                                   choices=[
                                                       ("400", _("Very Low")),
                                                       ("480", _("Low")),
                                                       ("800", _("Normal")),
                                                       ("1500", _("High")),
                                                       ("3200", _("HD"))
                                                   ])
config.ondemand.ShowiRadioPlayer = ConfigYesNo(default=True)
config.ondemand.ShowiRadioWMA = ConfigYesNo(default=False)
config.ondemand.ShowFavoriteLogos = ConfigYesNo(default=True)
config.ondemand.ShowFavoriteDefault = ConfigYesNo(default=True)
config.ondemand.ShowShoutcastLogos = ConfigYesNo(default=True)
config.ondemand.ShowShoutcastDefault = ConfigYesNo(default=True)
config.ondemand.ShowTuneinLogos = ConfigYesNo(default=True)
config.ondemand.ShowTuneinDefault = ConfigYesNo(default=True)
config.ondemand.PrimaryDNS = ConfigIP(default=[0, 0, 0, 0])
config.ondemand.SecondaryDNS = ConfigIP(default=[0, 0, 0, 0])


def OnDemanMenu(menuid):
    if menuid == "mainmenu":
        return [(_("OnDemand"), main, "ondemand", None)]
    return []


def main(session, **kwargs):
    session.open(OnDemand_Screen)


def Plugins(**kwargs):
    plist = []