Пример #1
0
	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))
	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))
Пример #3
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)
Пример #4
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)
Пример #5
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)
Пример #6
0
 def createConfig(self):
     peerStreamingBoxes = []
     for url in getPeerStreamingBoxes():
         parsed = urlparse(url)
         peerStreamingBoxes.append(parsed.hostname)
     self.peerExist = len(peerStreamingBoxes) != 0
     peerDefault = None
     self.peer = None
     if self.peerExist:
         if config.clientmode.serverAddressType.value == "domain" and config.clientmode.serverDomain.value in peerStreamingBoxes:
             peerDefault = config.clientmode.serverDomain.value
         self.peer = ConfigSelection(default=peerDefault,
                                     choices=[(x, x)
                                              for x in peerStreamingBoxes])
     addressChoices = [("ip", _("IP")), ("domain", _("URL"))]
     if self.peerExist:
         addressChoices.append(("peer", _("Network peer")))
     addressTypeDefault = config.clientmode.serverAddressType.value
     if addressTypeDefault != "ip" and (
             peerDefault or self.peerExist
             and config.clientmode.serverDomain.value == ""):
         addressTypeDefault = "peer"
     self.addressType = ConfigSelection(default=addressTypeDefault,
                                        choices=addressChoices)