示例#1
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
			if is_found is False:
				self.createMenu()
		elif self.index == self.STATE_CHOISE_CHANNELLIST:
			self.enabled = ConfigYesNo(default = True)
			modes = {"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 = "19e")
			self.createMenu()
示例#2
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
		{
			"ok": self.keyGo,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"menu": self.doCloseRecursive,
		}, -2)

		self.session.postScanService = session.nav.getCurrentlyPlayingServiceOrGroup()

		self.list = []
		tlist = []

		known_networks = [ ]
		nims_to_scan = [ ]
		self.finished_cb = None

		for nim in nimmanager.nim_slots:
			# collect networks provided by this tuner

			need_scan = False
			networks = self.getNetworksForNim(nim)

			print "nim %d provides" % nim.slot, networks
			print "known:", known_networks

			# we only need to scan on the first tuner which provides a network.
			# this gives the first tuner for each network priority for scanning.
			for x in networks:
				if x not in known_networks:
					need_scan = True
					print x, "not in ", known_networks
					known_networks.append(x)

			# don't offer to scan nims if nothing is connected
			if not nimmanager.somethingConnected(nim.slot):
				need_scan = False

			if need_scan:
				nims_to_scan.append(nim)

		# we save the config elements to use them on keyGo
		self.nim_enable = [ ]

		if len(nims_to_scan):
			self.scan_clearallservices = ConfigSelection(default = "yes", choices = [("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))])
			self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices))

			for nim in nims_to_scan:
				nimconfig = ConfigYesNo(default = True)
				nimconfig.nim_index = nim.slot
				self.nim_enable.append(nimconfig)
				self.list.append(getConfigListEntry(_("Scan ") + nim.slot_name + " (" + nim.friendly_type + ")", nimconfig))

		ConfigListScreen.__init__(self, self.list)
		self["header"] = Label(_("Automatic scan"))
		self["footer"] = Label(_("Press OK to scan"))
示例#3
0
	def startservicescan(self, postScanService=None, wasinstandby=False):
		self.wasinstandby = wasinstandby
		self.postScanService = postScanService

		tlist = []
		known_networks = [ ]
		nims_to_scan = [ ]

		for nim in nimmanager.nim_slots:
			# collect networks provided by this tuner
			need_scan = False
			networks = self.getNetworksForNim(nim)

			# we only need to scan on the first tuner which provides a network.
			# this gives the first tuner for each network priority for scanning.
			for x in networks:
				if x not in known_networks:
					need_scan = True
					print x, "not in ", known_networks
					known_networks.append(x)

# 			print "nim %d provides" % nim.slot, networks
# 			print "known:", known_networks
#
			# don't offer to scan nims if nothing is connected
			if not nimmanager.somethingConnected(nim.slot):
				need_scan = False

			if need_scan:
				nims_to_scan.append(nim)

		# we save the config elements to use them on keyGo
		self.nim_enable = [ ]

		if len(nims_to_scan):
			for nim in nims_to_scan:
				nimconfig = ConfigYesNo(default = True)
				nimconfig.nim_index = nim.slot
				self.nim_enable.append(nimconfig)

		self.scanList = []
		self.known_networks = set()
		self.nim_iter=0
		self.buildTransponderList()
示例#4
0
文件: plugin.py 项目: Tron3/enigma2
    def createSetup(self):
        self.testtype = ConfigSelection(
            choices={"quick": _("Quick"), "random": _("Random"), "complete": _("Complete")}, default="quick"
        )
        self.testtypeEntry = getConfigListEntry(_("Test type"), self.testtype)
        self.list.append(self.testtypeEntry)

        self.loopsfailed = ConfigSelection(
            choices={
                "-1": "Every known",
                "1": "1",
                "2": "2",
                "3": "3",
                "4": "4",
                "5": "5",
                "6": "6",
                "7": "7",
                "8": "8",
            },
            default="3",
        )
        self.loopsfailedEntry = getConfigListEntry(
            _("Stop testing plane after # failed transponders"), self.loopsfailed
        )
        self.list.append(self.loopsfailedEntry)

        self.loopssuccessful = ConfigSelection(
            choices={
                "-1": "Every known",
                "1": "1",
                "2": "2",
                "3": "3",
                "4": "4",
                "5": "5",
                "6": "6",
                "7": "7",
                "8": "8",
            },
            default="1",
        )
        self.loopssuccessfulEntry = getConfigListEntry(
            _("Stop testing plane after # successful transponders"), self.loopssuccessful
        )
        self.list.append(self.loopssuccessfulEntry)

        self.log = ConfigYesNo(False)
        if harddiskmanager.HDDCount() > 0:
            self.logEntry = getConfigListEntry(_("Log results to harddisk"), self.log)
            self.list.append(self.logEntry)

        self["config"].list = self.list
        self["config"].l.setList(self.list)
class Satscan(ConfigListScreen, Screen):
	skin = 	"""
		<screen position="center,center" size="500,320" title="Satscan">
			<widget name="config"	position="0,0"		font="Regular;20" size="500,150" scrollbarMode="showOnDemand" />
			<widget name="text"		position="0,158"	font="Regular;20" size="500,120" halign="center" />

			<ePixmap pixmap="skin_default/buttons/red.png" position="0,278" size="140,40" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/green.png" position="150,278" size="140,40" alphatest="on" />

			<widget source="key_red" render="Label" position="0,278" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1"/>
			<widget source="key_green" render="Label" position="150,278" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1"/>

		</screen>
		"""

	def KeyNone(self):
		None

	def callbackNone(self, *retval):
		None

	def OpenFrontend(self):
		frontend = None
		resource_manager = eDVBResourceManager.getInstance()
		if resource_manager is None:
			print "get resource manager instance failed"
		else:
			self.raw_channel = resource_manager.allocateRawChannel(int(self.select_nim.value))

			if self.raw_channel is None:
				print "allocateRawChannel failed"
			else:
				frontend = self.raw_channel.getFrontend()
				if frontend is None:
					print "getFrontend failed"
		return(frontend)

	def GetI2CBusFromSlot(self, slot_number):
		self.i2c_mapping_table = [2, 3, 1, 0]

		i2cbus = nimmanager.getI2CDevice(slot_number)

		if i2cbus is not None and i2cbus >= 0:
			return i2cbus

		# hack for VU+
		if slot_number >= 0 and slot_number < 4:
			i2cbus = self.i2c_mapping_table[slot_number]
		else:
			i2cbus = -1

		return i2cbus

	def SelectedNimToList(self, selected):
		current		= 0
		disabled	= 0

		for all_dvbs_pos in self.all_pos_per_dvbs_nim:
			if self.all_pos_per_dvbs_nim[current] == None:
				disabled = disabled + 1
			if current == int(selected):
				return current - disabled
			current = current + 1
		return -1

	def __init__(self, session):
		Screen.__init__(self, session)

		self.logfile			= open("/tmp/satscan.log", "w+", 0)
		self.executable			= None
		self.vuplus_quirks		= False

		for tryname in ("avl_azbox_blindscan", "avl_xtrend_blindscan", "vuplus_blindscan"):
			print "try:", tryname

			try:
				subprocess.check_call((tryname))
				self.executable = tryname
				break
			except OSError:
				print tryname + ": OSError"
				None
			except subprocess.CalledProcessError:
				# vuplus_blindscan returns -1 when called with no arguments
				print tryname + ": CalledProcessError"
				self.executable = tryname
				break

		print "executable = ", self.executable

		if self.executable == "vuplus_blindscan":
			self.vuplus_quirks = True

		self.scan_circular		= ConfigYesNo(default = False)
		self.scan_transponders	= ConfigYesNo(default = False)
		self.scan_clearservices	= ConfigYesNo(default = False)
		self.scan_fta			= ConfigYesNo(default = False)

		self.current_service		= self.session.nav.getCurrentlyPlayingServiceReference()
		self.all_pos_per_dvbs_nim	= []

		nimmanager.enumerateNIMs()

		for nim_slot in nimmanager.nim_slots:
			if nim_slot.isCompatible("DVB-S"):
				self.all_pos_per_dvbs_nim.append(nimmanager.getSatListForNim(nim_slot.slot))
			else:
				self.all_pos_per_dvbs_nim.append(None)

		#print "*** all_pos_per_dvbs_nim: ", self.all_pos_per_dvbs_nim

		self.current_orb_pos = 192
		current_service = self.session.nav.getCurrentService()

		if current_service is not None:
			feinfo = current_service.frontendInfo()
			if feinfo is not None:
				fedata = feinfo.getAll(True)
				if fedata.get("tuner_type", "UNKNOWN") == "DVB-S":
					self.current_orb_pos = fedata.get("orbital_position", 0);

		selectable_nims = []
		for nim in nimmanager.nim_slots:
			if nim.config_mode == "nothing":
				continue
			if nim.config_mode == "advanced" and len(nimmanager.getSatListForNim(nim.slot)) < 1:
				continue
			if nim.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(nim.slot_id, int(nim.config.connectedTo.value))
				if nim.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			if nim.isCompatible("DVB-S"):
				selectable_nims.append((str(nim.slot), nim.friendly_full_description))

		self.select_nim = ConfigSelection(choices = selectable_nims)

		self.positions_config_list = []
		for nim_slot in nimmanager.nim_slots:
			if nim_slot.isCompatible("DVB-S"):
				self.positions_config_list.append(getConfigSatlist(self.current_orb_pos, self.all_pos_per_dvbs_nim[nim_slot.slot]))

		self.config_list = []
		ConfigListScreen.__init__(self, self.config_list)

		if self.select_nim.value != None and self.select_nim.value != "" :
			self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "ColorActions" ],
			{
				"red":		self.keyCancel,
				"green":	self.keyGo,
				"ok":		self.keyGo,
				"cancel":	self.keyCancel,
			}, -2)

			self["key_red"]		= StaticText(_("Exit"))
			self["key_green"]	= StaticText(_("Start"))

			if self.vuplus_quirks:
				disclaimer = _("WARNING! Blindscan may make the tuner malfunction on a VU+ receiver. A reboot afterwards may be required to return to proper tuner function.\n\n")
			else:
				disclaimer = ""

			self["text"] = Label(disclaimer + _("Press OK to start scanning"))

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

			self["key_red"]		= StaticText(_("Exit"))
			self["key_green"]	= StaticText(" ")
			self["text"]		= Label(_("Tuner not set up, can't scan"))

	def FillConfigList(self):
		self.config_list = []
		self.multiscanlist = []
		index_to_scan = int(self.select_nim.value)

		self.tunerEntry = getConfigListEntry(_("Tuner"), self.select_nim)
		self.config_list.append(self.tunerEntry)

		if self.select_nim == [ ]:
			return

		nim = nimmanager.nim_slots[index_to_scan]

		if not nim.isCompatible("DVB-S"):
			return

		self.config_list.append(getConfigListEntry(_('Satellite'), self.positions_config_list[self.SelectedNimToList(index_to_scan)]))
		self.config_list.append(getConfigListEntry(_("Scan circular polarisation"), self.scan_circular))
		self.config_list.append(getConfigListEntry(_("Scan found transponders"), self.scan_transponders))
		self.config_list.append(getConfigListEntry(_("Clear position before scan"), self.scan_clearservices))
		self.config_list.append(getConfigListEntry(_("Scan only FTA services"), self.scan_fta))
		self["config"].list = self.config_list
		self["config"].l.setList(self.config_list)

		self.scan_transponders.setValue(True)

	def UpdateConfigListPositions(self):
		cur = self["config"].getCurrent()
		if cur == self.tunerEntry:
			self.FillConfigList()

	def keyLeft(self):
		ConfigListScreen.keyLeft(self)
		self.UpdateConfigListPositions()

	def keyRight(self):
		ConfigListScreen.keyRight(self)
		self.UpdateConfigListPositions()

	def keyCancel(self):
		self.session.nav.playService(self.current_service)
		for x in self["config"].list:
			x[1].cancel()
		self.close()

	def PolarisationFirst(self):
		return 0

	def PolarisationLast(self):
		return 1

	def PolarisationToEnigma(self, pol_id):
		pol_tab_nc	= [ eDVBFrontendParametersSatellite.Polarisation_Horizontal, 	eDVBFrontendParametersSatellite.Polarisation_Vertical ]
		pol_tab_c	= [ eDVBFrontendParametersSatellite.Polarisation_CircularLeft,	eDVBFrontendParametersSatellite.Polarisation_CircularRight ]

		if pol_id == 0 or pol_id == 1:
			if self.scan_circular.value:
				return pol_tab_c[pol_id]
			else:
				return pol_tab_nc[pol_id]
		else:
			return -1

	def PolarisationToString(self, pol_id):
		pol_tab_nc	= [ "horizontal", 		"vertical" ]
		pol_tab_c	= [ "circular left",	"circular right" ]

		if pol_id == 0 or pol_id == 1:
			if self.scan_circular.value:
				return pol_tab_c[pol_id]
			else:
				return pol_tab_nc[pol_id]
		else:
			return "unknown polarisation"

	def PolarisationToShortString(self, pol_id):
		pol_tab_nc	= [ "H", "V" ]
		pol_tab_c	= [ "L", "R" ]

		if pol_id == 0 or pol_id == 1:
			if self.scan_circular.value:
				return pol_tab_c[pol_id]
			else:
				return pol_tab_nc[pol_id]
		else:
			return "U"

	def LOFFirst(self):
		return 0

	def LOFLast(self):
		return 1

	def LOFToFreq(self, lof_id):
		if lof_id == 0:
			return 11015
		if lof_id == 1:
			return 12515
		return 0

	def LOFToString(self, lof_id):
		if lof_id == 0:
			return "low"
		if lof_id == 1:
			return "high"
		return "unknown lof"

	def PositionToString(self, pos):
		if pos < 1800:
			return "%.1fE" % (float(pos) / 10)
		return "%.1fW" % (360 - (float(pos) / 10))

	def PositionToInt(self, pos):
		if pos < 1800:
			return pos
		return pos - 3600

	def keyGo(self):
		selected_nim			= int(self.SelectedNimToList(self.select_nim.value))
		selected_position		= self.positions_config_list[selected_nim].index
		nim_positions_list		= [self.all_pos_per_dvbs_nim[int(self.select_nim.value)][selected_position]]
		self.position			= nim_positions_list[0][0]
		self.position_name		= nim_positions_list[0][1]

		self.frontend = self.OpenFrontend()
		if self.frontend is None:
			self.oldref = self.session.nav.getCurrentlyPlayingServiceReference()
			self.session.nav.stopService()
			self.frontend = self.OpenFrontend()
		if self.frontend is None:
			print "*** cannot open frontend"
			return

		self.i2cbus = self.GetI2CBusFromSlot(int(self.select_nim.value))

		if self.i2cbus < 0:
			print "*** Can't find i2c bus for this nim"
			return

		#print "*** selected_nim =", selected_nim
		#print "*** selected_position =", selected_position
		#print "*** nim_positions_list =", nim_positions_list
		#print "*** position =", self.PositionToString(self.position), "(", self.position, ")"
		#print "*** position_name =", self.position_name

		self.tuner = Tuner(self.frontend)

		self.polarisation			= self.PolarisationFirst()
		self.lof					= self.LOFFirst()
		self.enigma_transponders	= []
		self.text_transponders		= []
		self.xml_transponders		= []

		self.status_screen = self.session.openWithCallback(self.CallbackStatusScreenDone, SatscanStatus, self)

	def CallbackStatusScreenDone(self):

		if self.frontend:
			self.frontend = None
			del self.raw_channel
			self.raw_channel = None

		#print "*** text transponders:", self.text_transponders
		sorted_transponders = sorted(self.text_transponders, key=lambda entry: entry["freq"])
		# print "*** sorted text transponders:", sorted_transponders

		datafile = open("/tmp/satscan.data", "w+")
		for transponder in sorted_transponders:
			datafile.write("%s %d %s %s %s %d %s %s %s %s\n" \
					% (transponder["pos"], transponder["freq"], transponder["pol"], transponder["system"], transponder["mod"],
					transponder["sr"], transponder["fec"], transponder["inv"], transponder["pilot"], transponder["rolloff"]))
		datafile.close()

		#print "*** xml transponders:", self.xml_transponders
		sorted_transponders = sorted(self.xml_transponders, key=lambda entry: entry["freq"])
		#print "*** sorted xml transponders:", sorted_transponders

		xmlfile = open('/tmp/satscan-%s.xml' % (self.PositionToString(self.position)), "w+")
		xmlfile.write('<satellites>\n')
		xmlfile.write('    <sat name="%s" flags="0" position="%d">\n' % (self.position_name, self.PositionToInt(self.position)))
		for transponder in sorted_transponders:
			xmlfile.write('        <transponder frequency="%d" symbol_rate="%d" polarization="%d" fec_inner="%d" system="%d" modulation="%d" />\n' \
					% (transponder["freq"], transponder["sr"], transponder["pol"], transponder["fec"], transponder["system"], transponder["mod"]))
		xmlfile.write('    </sat>\n')
		xmlfile.write('</satellites\n')
		xmlfile.close()

		self.logfile.close()

		if self.scan_transponders.value:
			self.ScanTransponders()

		self.close(True)

	def ScanTransponders(self):

		if self.enigma_transponders == []:
			return

		flags = 0

		if self.scan_clearservices.value:
			flags |= eComponentScan.scanRemoveServices
		else:
			flags |= eComponentScan.scanDontRemoveUnscanned

		if self.scan_fta.value:
			flags |= eComponentScan.scanOnlyFree

		print "*** scanning transponders:"

		for transponder in self.enigma_transponders:
			print "-->", transponder.orbital_position, transponder.polarisation, transponder.frequency, \
					transponder.symbol_rate, transponder.system, transponder.inversion, transponder.pilot, transponder.pilot, \
					transponder.fec, transponder.modulation, transponder.rolloff

		self.session.open(ServiceScan, [{"transponders": self.enigma_transponders, "feid": int(self.select_nim.value), "flags": flags}])
示例#6
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("Fast Scan"))

		self.providers = {}
		
		#hacky way
		self.providers['Kontinent'] = (0, 900, True)
		self.providers['Ntvplus'] = (0, 900, True)
		self.providers['Raduga'] = (0, 900, True)
		self.providers['Telekarta'] = (0, 900, True)
		self.providers['Tricolor'] = (0, 900, True)
		
		#orgin
		#self.providers['Canal Digitaal'] = (0, 900, True)
		#self.providers['TV Vlaanderen'] = (0, 910, True)
		#self.providers['TéléSAT'] = (0, 920, True)
		#self.providers['Mobistar NL'] = (0, 930, False)
		#self.providers['Mobistar FR'] = (0, 940, False)
		#self.providers['AustriaSat'] = (0, 950, False)
		#self.providers['Czech Republic'] = (1, 30, False)
		#self.providers['Slovak Republic'] = (1, 31, False)


		self.transponders = ((12515000, 22000000, eDVBFrontendParametersSatellite.FEC_5_6, 192,
			eDVBFrontendParametersSatellite.Polarisation_Horizontal, eDVBFrontendParametersSatellite.Inversion_Unknown,
			eDVBFrontendParametersSatellite.System_DVB_S, eDVBFrontendParametersSatellite.Modulation_QPSK,
			eDVBFrontendParametersSatellite.RollOff_alpha_0_35, eDVBFrontendParametersSatellite.Pilot_Off),
			(12070000, 27500000, eDVBFrontendParametersSatellite.FEC_3_4, 235,
			eDVBFrontendParametersSatellite.Polarisation_Horizontal, eDVBFrontendParametersSatellite.Inversion_Unknown,
			eDVBFrontendParametersSatellite.System_DVB_S, eDVBFrontendParametersSatellite.Modulation_QPSK,
			eDVBFrontendParametersSatellite.RollOff_alpha_0_35, eDVBFrontendParametersSatellite.Pilot_Off))

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
		{
			"ok": self.keyGo,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"menu": self.closeRecursive,
		}, -2)

		nim_list = []

		# collect all nims which are *not* set to "nothing"
		for n in nimmanager.nim_slots:
			if not n.isCompatible("DVB-S"):
				continue
			if n.config_mode == "nothing":
				continue
			if n.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.getValue()))
				if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			nim_list.append((str(n.slot), n.friendly_full_description))

		providerList = list(x[0] for x in sorted(self.providers.iteritems(), key = operator.itemgetter(1)))

		lastConfiguration = eval(config.misc.fastscan.last_configuration.value)
		if not lastConfiguration:
			lastConfiguration = (nim_list[0][0], providerList[0], True, True, False)

		self.scan_nims = ConfigSelection(default = lastConfiguration[0], choices = nim_list)
		self.scan_provider = ConfigSelection(default = lastConfiguration[1], choices = providerList)
		self.scan_hd = ConfigYesNo(default = lastConfiguration[2])
		self.scan_keepnumbering = ConfigYesNo(default = lastConfiguration[3])
		self.scan_keepsettings = ConfigYesNo(default = lastConfiguration[4])

		self.list = []
		self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
		self.list.append(self.tunerEntry)

		self.scanProvider = getConfigListEntry(_("Provider"), self.scan_provider)
		self.list.append(self.scanProvider)

		self.scanHD = getConfigListEntry(_("HD list"), self.scan_hd)
		self.list.append(self.scanHD)

		self.list.append(getConfigListEntry(_("Use fastscan channel numbering"), self.scan_keepnumbering))

		self.list.append(getConfigListEntry(_("Use fastscan channel names"), self.scan_keepsettings))

		ConfigListScreen.__init__(self, self.list)
		self["config"].list = self.list
		self["config"].l.setList(self.list)

		self.finished_cb = None

		self["introduction"] = Label(_("Select your provider, and press OK to start the scan"))
示例#7
0
文件: plugin.py 项目: torac/enigma2
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("Fast Scan"))

        self["actions"] = ActionMap(
            ["SetupActions", "MenuActions"],
            {"ok": self.keyGo, "cancel": self.keyCancel, "menu": self.closeRecursive},
            -2,
        )

        nim_list = []
        # collect all nims which are *not* set to "nothing"
        for n in nimmanager.nim_slots:
            if not n.isCompatible("DVB-S"):
                continue
            if n.config_mode == "nothing":
                continue
            if n.config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.getValue()))
                if (
                    n.type == nimmanager.nim_slots[root_id].type
                ):  # check if connected from a DVB-S to DVB-S2 Nim or vice versa
                    continue
            nim_list.append((str(n.slot), n.friendly_full_description))

        self.scan_nims = ConfigSelection(choices=nim_list)
        provider_list = []
        provider_list.append((str(900), "Canal Digitaal"))
        provider_list.append((str(910), "TV Vlaanderen"))
        provider_list.append((str(920), "TéléSAT"))
        provider_list.append((str(930), "Mobistar NL"))
        provider_list.append((str(940), "Mobistar FR"))
        provider_list.append((str(950), "AustriaSat"))
        provider_list.append((str(30), "Czech Republic"))
        provider_list.append((str(31), "Slovak Republic"))

        self.scan_provider = ConfigSelection(choices=provider_list)
        self.scan_hd = ConfigYesNo(default=True)
        self.scan_keepnumbering = ConfigYesNo(default=False)
        self.scan_keepsettings = ConfigYesNo(default=False)

        self.list = []
        self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
        self.list.append(self.tunerEntry)

        self.scanProvider = getConfigListEntry(_("Provider"), self.scan_provider)
        self.list.append(self.scanProvider)

        self.scanHD = getConfigListEntry(_("HD list"), self.scan_hd)
        self.list.append(self.scanHD)

        self.list.append(getConfigListEntry(_("Use fastscan channel numbering"), self.scan_keepnumbering))

        self.list.append(getConfigListEntry(_("Use fastscan channel names"), self.scan_keepsettings))

        ConfigListScreen.__init__(self, self.list)
        self["config"].list = self.list
        self["config"].l.setList(self.list)

        self.finished_cb = None

        self["introduction"] = Label(_("Select your provider, and press OK to start the scan"))
示例#8
0
#Plugins
from Plugins.Plugin import PluginDescriptor
from mixes import Mixes

mixes = Mixes().read()
choices = sorted([(mixes[x]["key"], mixes[x]["name"]) for x in mixes],
                 key=lambda listItem: listItem[1])

default_mix = "dsayers_vmuk_into_skyuk"
ABMpath = "/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker/custom/"

config.plugins.abmImporter = ConfigSubsection()
config.plugins.abmImporter.mix = ConfigSelection(default=default_mix,
                                                 choices=choices)
config.plugins.abmImporter.enableImporter = ConfigYesNo(default=False)
config.plugins.abmImporter.leadTime = ConfigSelection(
    default="5",
    choices=[("1", _("1 minute")), ("2", _("2 minutes")),
             ("3", _("3 minutes")), ("5", _("5 minutes")),
             ("10", _("10 minutes")), ("20", _("20 minutes")),
             ("30", _("30 minutes"))])


class ABMCustomMixImporterScreen(Setup):
    skin = """
		<screen position="340,70" size="600,620">
			<widget source="key_red" render="Label" position="0,0" size="140,40" valign="center" halign="center" zPosition="4" foregroundColor="white" backgroundColor="#9f1313" font="Regular;18" transparent="1"/>
			<widget source="key_green" render="Label" position="150,0" size="140,40" valign="center" halign="center" zPosition="4" foregroundColor="white" backgroundColor="#1f771f" font="Regular;18" transparent="1"/>
			<widget source="key_yellow" render="Label" position="300,0" size="140,40" valign="center" halign="center" zPosition="4" foregroundColor="white" backgroundColor="#a08500" font="Regular;18" transparent="1"/>
			<widget source="key_blue" render="Label" position="450,0" size="140,40" valign="center" halign="center" zPosition="4" foregroundColor="white" backgroundColor="#a08500" font="Regular;18" transparent="1"/>
示例#9
0
        for p in plugins.getPlugins(
                where=PluginDescriptor.WHERE_EXTENSIONSMENU):
            if p.name != _("Podcast"):
                list.append(((boundFunction(self.getPluginName, p.name),
                              boundFunction(self.runPlugin,
                                            p), lambda: True), None))
        return list

    def showMovies(self):
        pass


###################################################

config.plugins.Podcast = ConfigSubsection()
config.plugins.Podcast.buffer = ConfigYesNo(default=True)
config.plugins.Podcast.bufferDevice = ConfigText(default="/media/hdd/",
                                                 fixed_size=False)
config.plugins.Podcast.keepStored = ConfigSelection(choices={
    "delete": _("delete"),
    "keep": _("keep on device"),
    "ask": _("ask me")
},
                                                    default="delete")

###################################################


def encodeUrl(url):
    url = url.replace("&amp;", "&")
    url = url.replace("&lt;", "<")
示例#10
0
文件: plugin.py 项目: grantor/enigma2
	def __init__(self, session, nimList):
		Screen.__init__(self, session)
		self.setTitle(_("Fast Scan"))

		self.providers = {}
		self.providers['Canal Digitaal'] = (1, 900, True)
		self.providers['TV Vlaanderen'] = (1, 910, True)
		self.providers['TéléSAT'] = (0, 920, True)
		self.providers['AustriaSat'] = (0, 950, False)
		self.providers['Skylink Czech Republic'] = (1, 30, False)
		self.providers['Skylink Slovak Republic'] = (1, 31, False)
		self.providers['TéléSAT Astra3'] = (1, 920, True)
		self.providers['AustriaSat Astra3'] = (1, 950, False)
		self.providers['Canal Digitaal Astra 1'] = (0, 900, True)
		self.providers['TV Vlaanderen  Astra 1'] = (0, 910, True)

		self.transponders = ((12515000, 22000000, eDVBFrontendParametersSatellite.FEC_5_6, 192,
			eDVBFrontendParametersSatellite.Polarisation_Horizontal, eDVBFrontendParametersSatellite.Inversion_Unknown,
			eDVBFrontendParametersSatellite.System_DVB_S, eDVBFrontendParametersSatellite.Modulation_QPSK,
			eDVBFrontendParametersSatellite.RollOff_alpha_0_35, eDVBFrontendParametersSatellite.Pilot_Off),
			(12070000, 27500000, eDVBFrontendParametersSatellite.FEC_3_4, 235,
			eDVBFrontendParametersSatellite.Polarisation_Horizontal, eDVBFrontendParametersSatellite.Inversion_Unknown,
			eDVBFrontendParametersSatellite.System_DVB_S, eDVBFrontendParametersSatellite.Modulation_QPSK,
			eDVBFrontendParametersSatellite.RollOff_alpha_0_35, eDVBFrontendParametersSatellite.Pilot_Off))

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
		{
			"ok": self.keyGo,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"menu": self.closeRecursive,
		}, -2)

		providerList = list(x[0] for x in sorted(self.providers.iteritems(), key = operator.itemgetter(1)))

		lastConfiguration = eval(config.misc.fastscan.last_configuration.value)
		if not lastConfiguration:
			lastConfiguration = (nimList[0][0], providerList[0], True, True, False)

		self.scan_nims = ConfigSelection(default = lastConfiguration[0], choices = nimList)
		self.scan_provider = ConfigSelection(default = lastConfiguration[1], choices = providerList)
		self.scan_hd = ConfigYesNo(default = lastConfiguration[2])
		self.scan_keepnumbering = ConfigYesNo(default = lastConfiguration[3])
		self.scan_keepsettings = ConfigYesNo(default = lastConfiguration[4])

		self.list = []
		self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
		self.list.append(self.tunerEntry)

		self.scanProvider = getConfigListEntry(_("Provider"), self.scan_provider)
		self.list.append(self.scanProvider)

		self.scanHD = getConfigListEntry(_("HD list"), self.scan_hd)
		self.list.append(self.scanHD)

		self.list.append(getConfigListEntry(_("Use fastscan channel numbering"), self.scan_keepnumbering))

		self.list.append(getConfigListEntry(_("Use fastscan channel names"), self.scan_keepsettings))

		ConfigListScreen.__init__(self, self.list)
		self["config"].list = self.list
		self["config"].l.setList(self.list)

		self.finished_cb = None

		self["introduction"] = Label(_("Select your provider, and press OK to start the scan"))
示例#11
0
			})

		self.onFirstExecBegin.append(self.doServiceScan)

	def doServiceScan(self):
		self["scan"] = CableScan(self["scan_state"], self["scan_progress"], self.scanTuner, self.scanNetwork, self.scanFrequency, self.scanSymbolRate, self.scanModulation, self.keepNumbers, self.hdList)

	def ok(self):
		if self["scan"].isDone():
			self.close()

	def cancel(self):
		self.close()

config.plugins.CableScan = ConfigSubsection()
config.plugins.CableScan.keepnumbering = ConfigYesNo(default = False)
config.plugins.CableScan.hdlist = ConfigYesNo(default = False)
config.plugins.CableScan.frequency = ConfigFloat(default = [323, 0], limits = [(50, 999),(0, 999)])
config.plugins.CableScan.symbolrate = ConfigInteger(default = 6875, limits = (1, 9999))
config.plugins.CableScan.networkid = ConfigInteger(default = 0, limits = (0, 99999))
config.plugins.CableScan.modulation = ConfigSelection(
	choices =
		[(str(eDVBFrontendParametersCable.Modulation_QAM16), "16-QAM"),
		(str(eDVBFrontendParametersCable.Modulation_QAM32), "32-QAM"),
		(str(eDVBFrontendParametersCable.Modulation_QAM64), "64-QAM"),
		(str(eDVBFrontendParametersCable.Modulation_QAM128), "128-QAM"),
		(str(eDVBFrontendParametersCable.Modulation_QAM256), "256-QAM")],
	default = str(eDVBFrontendParametersCable.Modulation_QAM64))
config.plugins.CableScan.auto = ConfigYesNo(default = True)

class CableScanScreen(ConfigListScreen, Screen):
示例#12
0
###################################################
from Components.config import config, ConfigSelection, ConfigYesNo, ConfigText, getConfigListEntry
try:
    import simplejson as json
except Exception:
    import json
###################################################

###################################################
# Config options for HOST
###################################################
config.plugins.iptvplayer.tvgrypl_default_quality = ConfigSelection(
    default="SD",
    choices=[("MOB", "MOB: niska"), ("SD", "SD: standardowa"),
             ("HD", "HD: wysoka")])  #, ("FHD", "FHD: bardzo wysoka")
config.plugins.iptvplayer.tvgrypl_use_dq = ConfigYesNo(default=True)
config.plugins.iptvplayer.tvgrypl_date_of_birth = ConfigText(
    default="2017-01-31", fixed_size=False)


def GetConfigList():
    optionList = []
    optionList.append(
        getConfigListEntry("Domyślna jakość wideo:",
                           config.plugins.iptvplayer.tvgrypl_default_quality))
    optionList.append(
        getConfigListEntry("Używaj domyślnej jakości wideo:",
                           config.plugins.iptvplayer.tvgrypl_use_dq))
    optionList.append(
        getConfigListEntry("Wprowadź datę urodzenia [RRRRR-MM-DD]:",
                           config.plugins.iptvplayer.tvgrypl_date_of_birth))
示例#13
0
from . import _
from Components.ActionMap import ActionMap
from Components.Button import Button
from Components.config import config, ConfigSubsection, ConfigYesNo, getConfigListEntry
from Components.ConfigList import ConfigListScreen
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen

config.plugins.servicehisilicon = ConfigSubsection()
config.plugins.servicehisilicon.activate = ConfigYesNo(default=False)


class HisiSetup(ConfigListScreen, Screen):
    skin = """
		<screen name="HisiSetup" position="center,center" size="574,165" title="%s">
			<widget name="config" position="10,10" size="554,100" scrollbarMode="showOnDemand" transparent="1" />
			<widget name="key_red" position="157,121" size="140,40" valign="center" halign="center" zPosition="4" foregroundColor="white" font="Regular;18" transparent="1" /> 
			<widget name="key_green" position="317,121" size="140,40" valign="center" halign="center" zPosition="4" foregroundColor="white" font="Regular;18" transparent="1" /> 
			<ePixmap name="red" position="156,121" zPosition="2" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
			<ePixmap name="green" position="317,121" zPosition="2" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
		</screen>""" % _("ServiceHisilicon Setup")

    def __init__(self, session, args=0):
        self.session = session
        Screen.__init__(self, session)

        self.list = []
        self.list.append(
            getConfigListEntry(
                _("Enable ServiceHisilicon (Need restart GUI):"),
                config.plugins.servicehisilicon.activate))
示例#14
0
import Plugins.Plugin
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigInteger, ConfigSubList, ConfigSubDict, ConfigText, configfile, ConfigYesNo
from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_LANGUAGE, SCOPE_PLUGINS
import os
import gettext

currentmcversion = "099"
currentmcplatform = "sh4"

config.plugins.mc_favorites = ConfigSubsection()
config.plugins.mc_favorites.foldercount = ConfigInteger(0)
config.plugins.mc_favorites.folders = ConfigSubList()

config.plugins.mc_globalsettings = ConfigSubsection()
config.plugins.mc_globalsettings.showinmainmenu = ConfigYesNo(default=True)
config.plugins.mc_globalsettings.showinextmenu = ConfigYesNo(default=False)
config.plugins.mc_globalsettings.currentversion = ConfigInteger(0, (0, 999))
config.plugins.mc_globalsettings.currentplatform = ConfigText(
    default=currentmcplatform)

config.plugins.mc_globalsettings.currentversion.value = currentmcversion
config.plugins.mc_globalsettings.currentplatform.value = currentmcplatform

PluginLanguageDomain = "HDMUMediaCenter"
PluginLanguagePath = "Extensions/BMediaCenter/locale"
# Load Language


def localeInit():
    lang = language.getLanguage()[:2]
示例#15
0
    (_("Power long"), "power_long", ""),
    (_("Context"), "contextMenu", "Infobar/showExtensionSelection"),
    (_("SAT"), "sat", "Infobar/openSatellites"),
    (_("SAT long"), "sat_long", ""),
    (_("Prov"), "prov", ""),
    (_("Prov long"), "prov_long", ""),
    (_("F1/LAN"), "f1", ""),
    (_("F1/LAN long"), "f1_long", ""),
    (_("F2"), "f2", ""),
    (_("F2 long"), "f2_long", ""),
    (_("F3"), "f3", ""),
    (_("F3 long"), "f3_long", ""),
]

config.misc.ButtonSetup = ConfigSubsection()
config.misc.ButtonSetup.additional_keys = ConfigYesNo(default=True)
for x in ButtonSetupKeys:
    exec "config.misc.ButtonSetup." + x[1] + " = ConfigText(default='" + x[
        2] + "')"


def getButtonSetupFunctions():
    ButtonSetupFunctions = []
    twinPlugins = []
    twinPaths = {}
    pluginlist = plugins.getPlugins(PluginDescriptor.WHERE_EVENTINFO)
    pluginlist.sort(key=lambda p: p.name)
    for plugin in pluginlist:
        if plugin.name not in twinPlugins and plugin.path and 'selectedevent' not in plugin.__call__.func_code.co_varnames:
            if twinPaths.has_key(plugin.path[24:]):
                twinPaths[plugin.path[24:]] += 1
示例#16
0
 def setScreen(self):
     self.list = []
     if self.step == 1:
         self["introduction"].setText(
             _("The overscan wizard helps you to setup your TV in the correct way.\n\n"
               "For the majority of TV's, the factory default is to have overscan enabled. "
               "This means you are always watching a \"zoomed in\" picture instead of real HD, and parts of the user inferface (skin) may be invisible.\n\n"
               "The yellow area means a 5% border area of a full HD picture will be invisible.\n"
               "The green area means a 10% border area of a full HD picture will be invisible.\n\n"
               "In other words, if the yellow box touches all four sides of your screen, you have at least 5% overscan on all sides.\n\n"
               "If you see the tips of all eight arrowheads, then your TV has overscan disabled.\n\n"
               "Test Pattern by TigerDave - www.tigerdave.com/ht_menu.htm"))
         self.yes_no = ConfigYesNo(default=True, graphic=False)
         self.list.append(
             getConfigListEntry(_("Did you see all eight arrow heads?"),
                                self.yes_no))
         self.save_new_position = False
         setPosition(0, 0, 0, 0)
     elif self.step == 2:
         self.Timer.stop()
         self["title"].setText(_("Overscan wizard"))
         self["introduction"].setText(
             _("It seems you did not see all the eight arrow heads. This means your TV "
               "has overscan enabled, and is not configured properly.\n\n"
               "Please refer to your TV's manual to find how you can disable overscan on your TV. Look for terms like 'Just fit', 'Full width', etc. "
               "If you can't find it, ask other users at http://forums.openpli.org.\n\n"
               ))
         self.list.append(
             getConfigListEntry(_("Did you see all eight arrow heads?"),
                                self.yes_no))
         self.yes_no.value = True
         self.save_new_position = False
         setPosition(0, 0, 0, 0)
     elif self.step == 3:
         self["introduction"].setText(
             _("You did not see all eight arrow heads. This means your TV has overscan enabled "
               "and presents you with a zoomed-in picture, causing you to loose part of a full HD screen. In addition to this "
               "you may also miss parts of the user interface, for example volume bars and more.\n\n"
               "You can now try to resize and change the position of the user interface until you see the eight arrow heads.\n\n"
               "When done press OK.\n\n"))
         self.dst_left = ConfigSlider(
             default=config.plugins.OSDPositionSetup.dst_left.value,
             increment=1,
             limits=(0, 150))
         self.dst_right = ConfigSlider(
             default=config.plugins.OSDPositionSetup.dst_right.value + 150,
             increment=1,
             limits=(0, 150))
         self.dst_top = ConfigSlider(
             default=config.plugins.OSDPositionSetup.dst_top.value,
             increment=1,
             limits=(0, 150))
         self.dst_bottom = ConfigSlider(
             default=config.plugins.OSDPositionSetup.dst_bottom.value + 150,
             increment=1,
             limits=(0, 150))
         self.list.append(getConfigListEntry(_("left"), self.dst_left))
         self.list.append(getConfigListEntry(_("right"), self.dst_right))
         self.list.append(getConfigListEntry(_("top"), self.dst_top))
         self.list.append(getConfigListEntry(_("bottom"), self.dst_bottom))
         setConfiguredPosition()
     elif self.step == 4:
         self["introduction"].setText(
             _("You did not see all eight arrow heads. This means your TV has overscan enabled "
               "and presents you with a zoomed-in picture, causing you to loose part of a full HD screen. In addition this "
               "you may also miss parts of the user interface, for example volume bars and more.\n\n"
               "Unfortunately, your model of receiver is not capable to adjust the dimensions of the user interface. "
               "If not everything is visible, you should change the installed skin to one that supports the overscan area of your TV.\n\n"
               "When you select a different skin, the user interface of your receiver will restart.\n\n"
               "Note: you can always start the Overscan wizard later,  via\n\nmenu->installation->system->Overscan wizard"
               ))
         self.yes_no.value = False
         self.list.append(
             getConfigListEntry(
                 _("Do you want to select a different skin?"), self.yes_no))
     elif self.step == 5:
         self.Timer.stop()
         self["title"].setText(_("Overscan wizard"))
         self["introduction"].setText(
             _("The overscan wizard has been completed.\n\n"
               "Note: you can always start the Overscan wizard later,  via\n\nMenu->Installation->System->Audio/Video->Overscan wizard"
               ))
         self.yes_no.value = True
         self.list.append(
             getConfigListEntry(
                 _("Do you want to quit the overscan wizard?"),
                 self.yes_no))
     elif self.step == 6:
         config.skin.primary_skin.value = "PLi-HD/skin.xml"
         config.save()
         self["introduction"].setText(
             _("The user interface of the receiver will now restart to select the selected skin"
               ))
         quitMainloop(3)
     self["config"].list = self.list
     self["config"].l.setList(self.list)
     if self["config"].instance:
         self.__layoutFinished()
示例#17
0
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.FileList import FileList
from Components.AVSwitch import AVSwitch
from Components.Sources.List import List
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigText, ConfigYesNo, getConfigListEntry

def getScale():
	return AVSwitch().getFramebufferScale()

config.pic = ConfigSubsection()
config.pic.framesize = ConfigInteger(default=30, limits=(5, 99))
config.pic.slidetime = ConfigInteger(default=10, limits=(1, 60))
config.pic.resize = ConfigSelection(default="1", choices = [("0", _("simple")), ("1", _("better"))])
config.pic.cache = ConfigYesNo(default=True)
config.pic.lastDir = ConfigText(default=resolveFilename(SCOPE_MEDIA))
config.pic.infoline = ConfigYesNo(default=True)
config.pic.loop = ConfigYesNo(default=True)
config.pic.bgcolor = ConfigSelection(default="#00000000", choices = [("#00000000", _("black")),("#009eb9ff", _("blue")),("#00ff5a51", _("red")), ("#00ffe875", _("yellow")), ("#0038FF48", _("green"))])
config.pic.textcolor = ConfigSelection(default="#0038FF48", choices = [("#00000000", _("black")),("#009eb9ff", _("blue")),("#00ff5a51", _("red")), ("#00ffe875", _("yellow")), ("#0038FF48", _("green"))])

class picshow(Screen):
	skin = """
		<screen name="picshow" position="center,center" size="560,440" title="Picture player" >
			<ePixmap pixmap="buttons/red.png" position="0,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="buttons/green.png" position="140,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
			<widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
			<widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
			<widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
示例#18
0
def InitLcd():
	detected = eDBoxLCD.getInstance() and eDBoxLCD.getInstance().detected()
	config.lcd = ConfigSubsection();
	if detected:
		def setLCDbright(configElement):
			ilcd.setBright(configElement.value);

		def setLCDcontrast(configElement):
			ilcd.setContrast(configElement.value);

		def setLCDinverted(configElement):
			ilcd.setInverted(configElement.value);

		def setLCDflipped(configElement):
			ilcd.setFlipped(configElement.value);

		standby_default = 0

		ilcd = LCD()

		if not ilcd.isOled():
			config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
			config.lcd.contrast.addNotifier(setLCDcontrast);
		else:
			config.lcd.contrast = ConfigNothing()
			standby_default = 1

		config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10))
		config.lcd.standby.addNotifier(setLCDbright);
		config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby)

		config.lcd.bright = ConfigSlider(default=5, limits=(0, 10))
		config.lcd.bright.addNotifier(setLCDbright);
		config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright)
		config.lcd.bright.callNotifiersOnSaveAndCancel = True

		config.lcd.invert = ConfigYesNo(default=False)
		config.lcd.invert.addNotifier(setLCDinverted);

		config.lcd.flip = ConfigYesNo(default=False)
		config.lcd.flip.addNotifier(setLCDflipped);

		if SystemInfo["LedPowerColor"]:
			def setLedPowerColor(configElement):
				open(SystemInfo["LedPowerColor"], "w").write(configElement.value)
			config.lcd.ledpowercolor = ConfigSelection(default = "1", choices = [("0", _("off")),("1", _("blue")), ("2", _("red")), ("3", _("violet"))])
			config.lcd.ledpowercolor.addNotifier(setLedPowerColor)

		if SystemInfo["LedStandbyColor"]:
			def setLedStandbyColor(configElement):
				open(SystemInfo["LedStandbyColor"], "w").write(configElement.value)
			config.lcd.ledstandbycolor = ConfigSelection(default = "3", choices = [("0", _("off")),("1", _("blue")), ("2", _("red")), ("3", _("violet"))])
			config.lcd.ledstandbycolor.addNotifier(setLedStandbyColor)

		if SystemInfo["LedSuspendColor"]:
			def setLedSuspendColor(configElement):
				open(SystemInfo["LedSuspendColor"], "w").write(configElement.value)
			config.lcd.ledsuspendcolor = ConfigSelection(default = "2", choices = [("0", _("off")),("1", _("blue")), ("2", _("red")), ("3", _("violet"))])
			config.lcd.ledsuspendcolor.addNotifier(setLedSuspendColor)

		if SystemInfo["Power4x7On"]:
			def setPower4x7On(configElement):
				open(SystemInfo["Power4x7On"], "w").write(configElement.value)
			config.lcd.power4x7on = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))])
			config.lcd.power4x7on.addNotifier(setPower4x7On)

		if SystemInfo["Power4x7Standby"]:
			def setPower4x7Standby(configElement):
				open(SystemInfo["Power4x7Standby"], "w").write(configElement.value)
			config.lcd.power4x7standby = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))])
			config.lcd.power4x7standby.addNotifier(setPower4x7Standby)

		if SystemInfo["Power4x7Suspend"]:
			def setPower4x7Suspend(configElement):
				open(SystemInfo["Power4x7Suspend"], "w").write(configElement.value)
			config.lcd.power4x7suspend = ConfigSelection(default = "off", choices = [("off", _("Off")), ("on", _("On"))])
			config.lcd.power4x7suspend.addNotifier(setPower4x7Suspend)

		if SystemInfo["LcdLiveTV"]:
			def lcdLiveTvChanged(configElement):
				setLCDLiveTv(configElement.value)
				configElement.save()
			config.lcd.showTv = ConfigYesNo(default = False)
			config.lcd.showTv.addNotifier(lcdLiveTvChanged)

			if "live_enable" in SystemInfo["LcdLiveTV"]:
				config.misc.standbyCounter.addNotifier(standbyCounterChangedLCDLiveTV, initial_call = False)
	else:
		def doNothing():
			pass
		config.lcd.contrast = ConfigNothing()
		config.lcd.bright = ConfigNothing()
		config.lcd.standby = ConfigNothing()
		config.lcd.bright.apply = lambda : doNothing()
		config.lcd.standby.apply = lambda : doNothing()

	config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call = False)
示例#19
0
class FastScanScreen(ConfigListScreen, Screen):
	skin = """
	<screen position="100,115" size="520,290" title="Fast Scan">
		<widget name="config" position="10,10" size="500,250" scrollbarMode="showOnDemand" />
		<widget name="introduction" position="10,265" size="500,25" font="Regular;20" halign="center" />
	</screen>"""

	def __init__(self, session, nimList):
		Screen.__init__(self, session)
		self.setTitle(_("Fast Scan"))
		
		self.providers = {}
		
		#hacky way
		self.providers['Kontinent'] = (0, 900, True)
		self.providers['Ntvplus'] = (0, 900, True)
		self.providers['Raduga'] = (0, 900, True)
		self.providers['Telekarta'] = (0, 900, True)
		self.providers['Tricolor'] = (0, 900, True)
		
		#orgin
		self.providers['Canal Digitaal'] = (1, 900, True)
		self.providers['TV Vlaanderen'] = (1, 910, True)
		self.providers['TéléSAT'] = (0, 920, True)
		self.providers['AustriaSat'] = (0, 950, False)
		self.providers['Skylink Czech Republic'] = (1, 30, False)
		self.providers['Skylink Slovak Republic'] = (1, 31, False)
		self.providers['TéléSAT Astra3'] = (1, 920, True)
		self.providers['AustriaSat Astra3'] = (1, 950, False)
		self.providers['Canal Digitaal Astra 1'] = (0, 900, True)
		self.providers['TV Vlaanderen  Astra 1'] = (0, 910, True)
		
		self.transponders = ((12515000, 22000000, eDVBFrontendParametersSatellite.FEC_5_6, 192,
			eDVBFrontendParametersSatellite.Polarisation_Horizontal, eDVBFrontendParametersSatellite.Inversion_Unknown,
			eDVBFrontendParametersSatellite.System_DVB_S, eDVBFrontendParametersSatellite.Modulation_QPSK,
			eDVBFrontendParametersSatellite.RollOff_alpha_0_35, eDVBFrontendParametersSatellite.Pilot_Off),
			(12070000, 27500000, eDVBFrontendParametersSatellite.FEC_3_4, 235,
			eDVBFrontendParametersSatellite.Polarisation_Horizontal, eDVBFrontendParametersSatellite.Inversion_Unknown,
			eDVBFrontendParametersSatellite.System_DVB_S, eDVBFrontendParametersSatellite.Modulation_QPSK,
			eDVBFrontendParametersSatellite.RollOff_alpha_0_35, eDVBFrontendParametersSatellite.Pilot_Off))

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
		{
			"ok": self.keyGo,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"menu": self.closeRecursive,
		}, -2)

		providerList = list(x[0] for x in sorted(self.providers.iteritems(), key = operator.itemgetter(1)))

		lastConfiguration = eval(config.misc.fastscan.last_configuration.value)
		if not lastConfiguration:
			lastConfiguration = (nimList[0][0], providerList[0], True, True, False)

		self.scan_nims = ConfigSelection(default = lastConfiguration[0], choices = nimList)
		self.scan_provider = ConfigSelection(default = lastConfiguration[1], choices = providerList)
		self.scan_hd = ConfigYesNo(default = lastConfiguration[2])
		self.scan_keepnumbering = ConfigYesNo(default = lastConfiguration[3])
		self.scan_keepsettings = ConfigYesNo(default = lastConfiguration[4])

		self.list = []
		self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
		self.list.append(self.tunerEntry)

		self.scanProvider = getConfigListEntry(_("Provider"), self.scan_provider)
		self.list.append(self.scanProvider)

		self.scanHD = getConfigListEntry(_("HD list"), self.scan_hd)
		self.list.append(self.scanHD)

		self.list.append(getConfigListEntry(_("Use fastscan channel numbering"), self.scan_keepnumbering))

		self.list.append(getConfigListEntry(_("Use fastscan channel names"), self.scan_keepsettings))

		ConfigListScreen.__init__(self, self.list)
		self["config"].list = self.list
		self["config"].l.setList(self.list)

		self.finished_cb = None

		self["introduction"] = Label(_("Select your provider, and press OK to start the scan"))


	def addSatTransponder(self, tlist, frequency, symbol_rate, polarisation, fec, inversion, orbital_position, system, modulation, rolloff, pilot):
		print "Add Sat: frequ: " + str(frequency) + " symbol: " + str(symbol_rate) + " pol: " + str(polarisation) + " fec: " + str(fec) + " inversion: " + str(inversion) + " modulation: " + str(modulation) + " system: " + str(system) + " rolloff" + str(rolloff) + " pilot" + str(pilot)
		print "orbpos: " + str(orbital_position)
		parm = eDVBFrontendParametersSatellite()
		parm.modulation = modulation
		parm.system = system
		parm.frequency = frequency * 1000
		parm.symbol_rate = symbol_rate * 1000
		parm.polarisation = polarisation
		parm.fec = fec
		parm.inversion = inversion
		parm.orbital_position = orbital_position
		parm.rolloff = rolloff
		parm.pilot = pilot
		tlist.append(parm)
		
	def readXML(self, xml):
		tlist = []

		import xml.dom.minidom as minidom
		xmldoc = "/usr/lib/enigma2/python/Plugins/SystemPlugins/FastScan/xml/" + xml + ".xml"
		xmldoc = minidom.parse(xmldoc)
		tr_list = xmldoc.getElementsByTagName('transporder')
		for lista in tr_list:      
			frequency = lista.getAttribute("frequency")
			symbolrate = lista.getAttribute("symbolrate")
			fec = lista.getAttribute("fec")
			orbpos = lista.getAttribute("orbpos")
			pol = lista.getAttribute("pol")
			system = lista.getAttribute("system")
			modulation = lista.getAttribute("modulation")
					
			self.frequency = frequency
			self.symbolrate = symbolrate
			if pol == "H":
			    pol = 0
			elif pol == "V":
			    pol = 1
			elif pol == "L":
			    pol = 2
			elif pol == "R":
			    pol = 3
			self.polarization =  pol # 0 - H, 1 - V, 2- CL, 3 - CR

			if fec == "Auto":
			    fec = 0
			elif fec == "1/2":
			    fec = 1
			elif fec == "2/3":
			    fec = 2
			elif fec == "3/4":
			    fec = 3
			elif fec == "3/5":
			    fec = 4
			elif fec == "4/5":
			    fec = 5
			elif fec == "5/6":
			    fec = 6
			elif fec == "7/8":
			    fec = 7
			elif fec == "8/9":
			    fec = 8
			elif fec == "9/10":
			    fec = 9
		
			self.fec = fec # 0 - Auto, 1 - 1/2, 2 - 2/3, 3 - 3/4, 4 - 3/5, 5 - 4/5, 6 - 5/6, 7 - 7/8, 8 - 8/9 , 9 - 9/10,
			
			self.inversion = 2 # 0 - off, 1 -on, 2 - AUTO
			
			self.orbpos = orbpos
			
			if system == "DVBS":
			    system = 0
			elif system == "DVBS2":
			    system = 1
			    
			self.system = system # DVB-S = 0, DVB-S2 = 1
			
			if modulation == "QPSK":
			    modulation = 0
			elif modulation == "8PSK":
			    modulation = 1
			    
			self.modulation = modulation # 0- QPSK, 1 -8PSK
			
			self.rolloff = 0 #
			
			self.pilot = 2 # 0 - off, 1 - on 2 - AUTO
		
			print "add sat transponder"
			self.addSatTransponder(tlist, int(self.frequency),
						int(self.symbolrate),
						int(self.polarization),
						int(fec),
						int(self.inversion),
						int(orbpos),
						int(self.system),
						int(self.modulation),
						int(self.rolloff),
						int(self.pilot))
		 
		self.session.open(ServiceScan, [{"transponders": tlist, "feid": int(self.scan_nims.getValue()), "flags": 0, "networkid": 0}])
									
	def keyGo(self):
		prov = self.scan_provider.value.lower()
		if prov == "tricolor" or prov == "kontinent" or prov == "telekarta" or prov == "ntvplus" or prov == "raduga":
		  self.readXML(self.scan_provider.value.lower())
		else:
		  config.misc.fastscan.last_configuration.value = `(self.scan_nims.value, self.scan_provider.value, self.scan_hd.value, self.scan_keepnumbering.value, self.scan_keepsettings.value)`
		  config.misc.fastscan.save()
		  self.startScan()


	def getTransponderParameters(self, number):
		transponderParameters = eDVBFrontendParametersSatellite()
		transponderParameters.frequency = self.transponders[number][0]
		transponderParameters.symbol_rate = self.transponders[number][1]
		transponderParameters.fec = self.transponders[number][2]
		transponderParameters.orbital_position = self.transponders[number][3]
		transponderParameters.polarisation = self.transponders[number][4]
		transponderParameters.inversion = self.transponders[number][5]
		transponderParameters.system = self.transponders[number][6]
		transponderParameters.modulation = self.transponders[number][7]
		transponderParameters.rolloff = self.transponders[number][8]
		transponderParameters.pilot = self.transponders[number][9]
		return transponderParameters

	def startScan(self):
		pid = self.providers[self.scan_provider.getValue()][1]
		if self.scan_hd.getValue() and self.providers[self.scan_provider.value][2]:
			pid += 1
		if self.scan_nims.value:
			self.session.open(FastScanStatus, scanTuner = int(self.scan_nims.getValue()),
				transponderParameters = self.getTransponderParameters(self.providers[self.scan_provider.getValue()][0]),
				scanPid = pid, keepNumbers = self.scan_keepnumbering.getValue(), keepSettings = self.scan_keepsettings.getValue(),
				providerName = self.scan_provider.getText())

	def keyCancel(self):
		self.close()
                                                          GetE2VideoPolicy, SetE2VideoPolicy, GetE2AudioCodecMixChoices, GetE2AudioCodecMixOption, IsExecutable
from Plugins.Extensions.IPTVPlayer.components.configbase import ConfigBaseWidget, ConfigIPTVFileSelection, COLORS_DEFINITONS
from Plugins.Extensions.IPTVPlayer.components.iptvplayerinit import TranslateTXT as _
###################################################

###################################################
# FOREIGN import
###################################################
import skin
from enigma import gRGB, eLabel, getDesktop
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigDirectory, ConfigYesNo, ConfigOnOff, Config, ConfigInteger, ConfigSubList, ConfigText, getConfigListEntry, configfile
###################################################
config.plugins.iptvplayer.extplayer_summary = ConfigSelection(default = "yes", choices = [('auto', _('Auto')), ('yes', _('Yes')), ('no', _('No'))])
config.plugins.iptvplayer.use_clear_iframe = ConfigYesNo(default = False)
config.plugins.iptvplayer.show_iframe = ConfigYesNo(default = True)
config.plugins.iptvplayer.iframe_file = ConfigIPTVFileSelection(fileMatch = "^.*\.mvi$", default = "/usr/share/enigma2/radio.mvi")
config.plugins.iptvplayer.clear_iframe_file = ConfigIPTVFileSelection(fileMatch = "^.*\.mvi$", default = "/usr/share/enigma2/black.mvi")

config.plugins.iptvplayer.remember_last_position = ConfigYesNo(default = False)
config.plugins.iptvplayer.fakeExtePlayer3 = ConfigSelection(default = "fake", choices = [("fake", " ")])
config.plugins.iptvplayer.rambuffer_sizemb_network_proto = ConfigInteger(0, (0, 999))
config.plugins.iptvplayer.rambuffer_sizemb_files = ConfigInteger(0, (0, 999))
config.plugins.iptvplayer.aac_software_decode = ConfigYesNo(default = False)
config.plugins.iptvplayer.ac3_software_decode = ConfigYesNo(default = False)
config.plugins.iptvplayer.eac3_software_decode = ConfigYesNo(default = False)
config.plugins.iptvplayer.dts_software_decode = ConfigYesNo(default = False)
config.plugins.iptvplayer.wma_software_decode = ConfigYesNo(default = True)
config.plugins.iptvplayer.mp3_software_decode = ConfigYesNo(default = False)
config.plugins.iptvplayer.stereo_software_decode = ConfigYesNo(default = False)
示例#21
0
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Components.Label import Label
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Scanner import openFile
from os.path import isdir as os_path_isdir
from mimetypes import guess_type

##################################
pname = _("Filebrowser")
pdesc = _("manage local Files")

config.plugins.filebrowser = ConfigSubsection()
config.plugins.filebrowser.savedirs = ConfigYesNo(default=True)
config.plugins.filebrowser.add_mainmenu_entry = ConfigYesNo(default=True)
config.plugins.filebrowser.add_extensionmenu_entry = ConfigYesNo(default=True)
config.plugins.filebrowser.path_left = ConfigText(default="/")
config.plugins.filebrowser.path_right = ConfigText(default="/")


##################################
class FilebrowserConfigScreen(ConfigListScreen, Screen):
    skin = """
        <screen position="100,100" size="550,400" title="" >
            <widget name="config" position="0,0" size="550,360" scrollbarMode="showOnDemand" />
            <widget name="buttonred" position="10,360" size="100,40" valign="center" halign="center" zPosition="1"  transparent="1" foregroundColor="white" font="Regular;18"/>
            <widget name="buttongreen" position="120,360" size="100,40" valign="center" halign="center" zPosition="1"  transparent="1" foregroundColor="white" font="Regular;18"/>
            <ePixmap name="pred" position="10,360" size="100,40" zPosition="0" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on"/>
            <ePixmap name="pgreen" position="120,360" size="100,40" zPosition="0" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on"/>
示例#22
0
from Components.Label import Label
from Components.config import config, ConfigSubsection, ConfigYesNo
from Screens.InfoBarGenerics import InfoBarSeek, InfoBarCueSheetSupport
from enigma import getDesktop, iPlayableService
from Screens.FixedMenu import FixedMenu
from Screens.HelpMenu import HelpableScreen
from Components.Sources.List import List
try:
	from Plugins.Extensions.MovieCut.plugin import main as MovieCut
except:
	print("[CutListEditor] import MovieCut failed")

import bisect

config.plugins.CutListEditor = ConfigSubsection()
config.plugins.CutListEditor.showIntro = ConfigYesNo(default=True)


def CutListEntry(where, what):
	w = where // 90
	ms = w % 1000
	s = (w // 1000) % 60
	m = (w // 60000) % 60
	h = w // 3600000
	if what == 0:
		type = "IN"
		type_col = 0x004000
	elif what == 1:
		type = "OUT"
		type_col = 0x400000
	elif what == 2:
示例#23
0
have_1080p = config.av.videorate.get("1080p", False)
if have_1080p:
    resolutions += (('fhd_p', _("FHD 50/60HZ Progressive Mode")), )

have_2160p = config.av.videorate.get("2160p", False)
if have_2160p:
    resolutions += (
        ('uhd_i', _("UHD Interlace Mode")),
        ('uhd_p', _("UHD Progressive Mode")),
        ('p2160_24', _("Enable 2160p24 Mode")),
        ('p2160_25', _("Enable 2160p25 Mode")),
        ('p2160_30', _("Enable 2160p30 Mode")),
    )

config.plugins.autoresolution = ConfigSubsection()
config.plugins.autoresolution.enable = ConfigYesNo(default=False)
config.plugins.autoresolution.showinfo = ConfigYesNo(default=True)
config.plugins.autoresolution.testmode = ConfigYesNo(default=False)
config.plugins.autoresolution.deinterlacer = ConfigSelection(
    default="auto",
    choices=[("off", _("off")), ("auto", _("auto")), ("on", _("on")),
             ("bob", _("bob"))])
config.plugins.autoresolution.deinterlacer_progressive = ConfigSelection(
    default="auto",
    choices=[("off", _("off")), ("auto", _("auto")), ("on", _("on")),
             ("bob", _("bob"))])
config.plugins.autoresolution.delay_switch_mode = ConfigSelection(
    default="1000",
    choices=[("0", "0 " + _("seconds")), ("50", "0.05 " + _("seconds")),
             ("500", "0.5 " + _("seconds")), ("1000", "1 " + _("second")),
             ("2000", "2 " + _("seconds")), ("3000", "3 " + _("seconds")),
示例#24
0
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigText, ConfigYesNo, getConfigListEntry
import skin


def getScale():
    return AVSwitch().getFramebufferScale()


config.pic = ConfigSubsection()
config.pic.framesize = ConfigInteger(default=30, limits=(5, 99))
config.pic.slidetime = ConfigInteger(default=10, limits=(1, 60))
config.pic.resize = ConfigSelection(default="1",
                                    choices=[("0", _("simple")),
                                             ("1", _("better"))])
config.pic.cache = ConfigYesNo(default=True)
config.pic.lastDir = ConfigText(default=resolveFilename(SCOPE_MEDIA))
config.pic.infoline = ConfigYesNo(default=True)
config.pic.loop = ConfigYesNo(default=True)
config.pic.stopPlayTv = ConfigYesNo(default=False)
config.pic.bgcolor = ConfigSelection(default="#00000000",
                                     choices=[("#00000000", _("black")),
                                              ("#009eb9ff", _("blue")),
                                              ("#00ff5a51", _("red")),
                                              ("#00ffe875", _("yellow")),
                                              ("#0038FF48", _("green"))])
config.pic.autoOrientation = ConfigYesNo(default=False)
config.pic.textcolor = ConfigSelection(default="#0038FF48",
                                       choices=[("#00000000", _("black")),
                                                ("#009eb9ff", _("blue")),
                                                ("#00ff5a51", _("red")),
示例#25
0
from pythonwifi import flags as wififlags

list = []
list.append("Unencrypted")
list.append("WEP")
list.append("WPA")
list.append("WPA/WPA2")
list.append("WPA2")

weplist = []
weplist.append("ASCII")
weplist.append("HEX")

config.plugins.wlan = ConfigSubsection()
config.plugins.wlan.essid = NoSave(ConfigText(default="", fixed_size=False))
config.plugins.wlan.hiddenessid = NoSave(ConfigYesNo(default=False))
config.plugins.wlan.encryption = NoSave(ConfigSelection(list, default="WPA2"))
config.plugins.wlan.wepkeytype = NoSave(
    ConfigSelection(weplist, default="ASCII"))
config.plugins.wlan.psk = NoSave(ConfigPassword(default="", fixed_size=False))


def existBcmWifi(iface):
    return os.path.exists("/tmp/bcm/" + iface)


def getWlConfName(iface):
    return "/etc/wl.conf.%s" % iface


def getWlanConfigName(iface):
示例#26
0
from Screens.ChoiceBox import ChoiceBox
from Components.ServicePosition import ServicePositionGauge
from Components.ActionMap import HelpableActionMap
from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
from Components.VideoWindow import VideoWindow
from Components.Label import Label
from Screens.InfoBarGenerics import InfoBarSeek, InfoBarCueSheetSupport
from Screens.FixedMenu import FixedMenu
from Screens.HelpMenu import HelpableScreen
from Components.Sources.List import List
from Components.config import config, ConfigYesNo
from Screens.MovieSelection import MovieSelection

apscParser = Struct(">qq")  # big-endian, 64-bit offset and 64-bit PTS/data

config.usage.cutlisteditor_tutorial_seen = ConfigYesNo(default=False)


def SecToMSS(sec):
    return "%d:%02d" % (sec / 60, sec % 60)


def CutListEntry(where, what, where_next=None):
    w = where / 90
    ms = w % 1000
    s = (w / 1000) % 60
    m = (w / 60000) % 60
    h = w / 3600000
    type, type_col = (("IN", 0x004000), ("OUT", 0x400000), ("MARK", 0x000040),
                      ("LAST", 0x000000), ("EOF", 0x000000),
                      ("", 0x000000))[what if what < 5 else 5]
示例#27
0
文件: BpSet.py 项目: gulipin/enigma2
    def updateList(self):

        self.ina_active = NoSave(ConfigYesNo(default="False"))
        self.ina_user = NoSave(ConfigText(fixed_size=False))
        self.ina_pass = NoSave(ConfigText(fixed_size=False))
        self.ina_alias = NoSave(ConfigText(fixed_size=False))
        self.ina_period = NoSave(ConfigNumber())
        self.ina_sysactive = NoSave(ConfigYesNo(default="False"))
        self.ina_system = NoSave(ConfigText(fixed_size=False))

        if fileExists("/etc/rc3.d/S20inadyn-mt"):
            self.ina_active.value = True
        else:
            self.ina_active.value = False
        ina_active1 = getConfigListEntry(_("Activate Inadyn"), self.ina_active)
        self.list.append(ina_active1)

        if fileExists("/etc/inadyn.conf"):
            f = open("/etc/inadyn.conf", 'r')
            for line in f.readlines():
                line = line.strip()
                if line.startswith('username '):
                    line = line[9:]
                    self.ina_user.value = line
                    ina_user1 = getConfigListEntry(_("Username"),
                                                   self.ina_user)
                    self.list.append(ina_user1)
                elif line.startswith('password '):
                    line = line[9:]
                    self.ina_pass.value = line
                    ina_pass1 = getConfigListEntry(_("Password"),
                                                   self.ina_pass)
                    self.list.append(ina_pass1)
                elif line.startswith('alias '):
                    line = line[6:]
                    self.ina_alias.value = line
                    ina_alias1 = getConfigListEntry(_("Alias"), self.ina_alias)
                    self.list.append(ina_alias1)
                elif line.startswith('update_period_sec '):
                    line = int(line[18:])
                    line = (line / 60)
                    self.ina_period.value = line
                    ina_period1 = getConfigListEntry(
                        _("Time Update in Minutes"), self.ina_period)
                    self.list.append(ina_period1)
                elif line.startswith('dyndns_system ') or line.startswith(
                        '#dyndns_system '):
                    if line.startswith('#'):
                        line = line[15:]
                        self.ina_sysactive.value = False
                    else:
                        line = line[14:]
                        self.ina_sysactive.value = True

                    ina_sysactive1 = getConfigListEntry(
                        _("Set System"), self.ina_sysactive)
                    self.list.append(ina_sysactive1)

                    self.ina_system.value = line
                    ina_system1 = getConfigListEntry(_("System"),
                                                     self.ina_system)
                    self.list.append(ina_system1)

            f.close()

        self["config"].list = self.list
        self["config"].l.setList(self.list)
示例#28
0
from skin import readSkin

profile("LOAD:Tools")
from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_ACTIVE_SKIN, SCOPE_CURRENT_SKIN, SCOPE_CONFIG
from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, ConfigSelection, NoSave, ConfigNumber
import Components.RecordingConfig
InitFallbackFiles()

profile("config.misc")
config.misc.boxtype = ConfigText(default = getBoxType())
config.misc.blackradiopic = ConfigText(default = resolveFilename(SCOPE_ACTIVE_SKIN, "black.mvi"))
radiopic = resolveFilename(SCOPE_ACTIVE_SKIN, "radio.mvi")
if os.path.exists(resolveFilename(SCOPE_CONFIG, "radio.mvi")):
	radiopic = resolveFilename(SCOPE_CONFIG, "radio.mvi")
config.misc.radiopic = ConfigText(default = radiopic)
config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False)
config.misc.isNextPowerTimerAfterEventActionAuto = ConfigYesNo(default=False)
config.misc.SyncTimeUsing = ConfigSelection(default = "0", choices = [("0", "Transponder Time"), ("1", _("NTP"))])
config.misc.NTPserver = ConfigText(default = 'pool.ntp.org', fixed_size=False)

config.misc.startCounter = ConfigInteger(default=0) # number of e2 starts...
config.misc.standbyCounter = NoSave(ConfigInteger(default=0)) # number of standby
config.misc.DeepStandby = NoSave(ConfigYesNo(default=False)) # detect deepstandby

#demo code for use of standby enter leave callbacks
#def leaveStandby():
#	print "!!!!!!!!!!!!!!!!!leave standby"

#def standbyCountChanged(configElement):
#	print "!!!!!!!!!!!!!!!!!enter standby num", configElement.value
#	from Screens.Standby import inStandby
示例#29
0
from Plugins.Extensions.IPTVPlayer.libs.e2ijson import loads as json_loads, dumps as json_dumps
from Plugins.Extensions.IPTVPlayer.libs import ph
###################################################
# FOREIGN import
###################################################
import re
import urllib
import HTMLParser
####################################################
# E2 GUI COMMPONENTS
####################################################
from Screens.MessageBox import MessageBox
####################################################
# Config options for HOST
####################################################
config.plugins.iptvplayer.MusicBox_premium = ConfigYesNo(default=False)
config.plugins.iptvplayer.MusicBox_login = ConfigText(default="", fixed_size=False)
####################################################
# Api keys
####################################################
audioscrobbler_api_key = "d49b72ffd881c2cb13b4595e67005ac4"
youtube_api_key = 'AIzaSyBbDY0UzvF5Es77M7S1UChMzNp0KsbaDPI'
HEADER = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:33.0) Gecko/20100101 Firefox/33.0'}

def GetConfigList():
    optionList = []
    optionList.append(getConfigListEntry("Użytkownik Last.fm", config.plugins.iptvplayer.MusicBox_premium))
    if config.plugins.iptvplayer.MusicBox_premium.value:
        optionList.append(getConfigListEntry(" Last.fm login:", config.plugins.iptvplayer.MusicBox_login))
    return optionList
示例#30
0
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))
	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.vixmenu = 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()
示例#31
0
文件: plugin.py 项目: torac/enigma2
class FastScanScreen(ConfigListScreen, Screen):
    skin = """
	<screen position="100,115" size="520,290" title="Fast Scan">
		<widget name="config" position="10,10" size="500,250" scrollbarMode="showOnDemand" />
		<widget name="introduction" position="10,265" size="500,25" font="Regular;20" halign="center" />
	</screen>"""

    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("Fast Scan"))

        self["actions"] = ActionMap(
            ["SetupActions", "MenuActions"],
            {"ok": self.keyGo, "cancel": self.keyCancel, "menu": self.closeRecursive},
            -2,
        )

        nim_list = []
        # collect all nims which are *not* set to "nothing"
        for n in nimmanager.nim_slots:
            if not n.isCompatible("DVB-S"):
                continue
            if n.config_mode == "nothing":
                continue
            if n.config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.getValue()))
                if (
                    n.type == nimmanager.nim_slots[root_id].type
                ):  # check if connected from a DVB-S to DVB-S2 Nim or vice versa
                    continue
            nim_list.append((str(n.slot), n.friendly_full_description))

        self.scan_nims = ConfigSelection(choices=nim_list)
        provider_list = []
        provider_list.append((str(900), "Canal Digitaal"))
        provider_list.append((str(910), "TV Vlaanderen"))
        provider_list.append((str(920), "TéléSAT"))
        provider_list.append((str(930), "Mobistar NL"))
        provider_list.append((str(940), "Mobistar FR"))
        provider_list.append((str(950), "AustriaSat"))
        provider_list.append((str(30), "Czech Republic"))
        provider_list.append((str(31), "Slovak Republic"))

        self.scan_provider = ConfigSelection(choices=provider_list)
        self.scan_hd = ConfigYesNo(default=True)
        self.scan_keepnumbering = ConfigYesNo(default=False)
        self.scan_keepsettings = ConfigYesNo(default=False)

        self.list = []
        self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
        self.list.append(self.tunerEntry)

        self.scanProvider = getConfigListEntry(_("Provider"), self.scan_provider)
        self.list.append(self.scanProvider)

        self.scanHD = getConfigListEntry(_("HD list"), self.scan_hd)
        self.list.append(self.scanHD)

        self.list.append(getConfigListEntry(_("Use fastscan channel numbering"), self.scan_keepnumbering))

        self.list.append(getConfigListEntry(_("Use fastscan channel names"), self.scan_keepsettings))

        ConfigListScreen.__init__(self, self.list)
        self["config"].list = self.list
        self["config"].l.setList(self.list)

        self.finished_cb = None

        self["introduction"] = Label(_("Select your provider, and press OK to start the scan"))

    def keyGo(self):
        self.startScan()

    def startScan(self):
        pid = int(self.scan_provider.getValue())
        if self.scan_hd.getValue() and pid >= 900 and pid < 930:
            pid += 1
        if self.scan_nims.getValue():
            self.session.open(
                FastScanStatus,
                scanTuner=int(self.scan_nims.getValue()),
                scanPid=pid,
                keepNumbers=self.scan_keepnumbering.getValue(),
                keepSettings=self.scan_keepsettings.getValue(),
                providerName=self.scan_provider.getText(),
            )

    def keyCancel(self):
        self.close()
示例#32
0
class DiseqcTesterTestTypeSelection(Screen, ConfigListScreen):

	def __init__(self, session, feid):
		Screen.__init__(self, session)
		# for the skin: first try MediaPlayerSettings, then Setup, this allows individual skinning
		self.skinName = ["DiseqcTesterTestTypeSelection", "Setup" ]
		self.setup_title = _("DiSEqC-tester settings")
		self.onChangedEntry = [ ]
		self.feid = feid

		self.list = []
		ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry)

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
			{
				"cancel": self.keyCancel,
				"save": self.keyOK,
				"ok": self.keyOK,
				"menu": self.closeRecursive,
			}, -2)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))

		self.createSetup()
		self.onLayoutFinish.append(self.layoutFinished)

	def layoutFinished(self):
		self.setTitle(self.setup_title)

	def createSetup(self):
		self.testtype = ConfigSelection(choices={"quick": _("Quick"), "random": _("Random"), "complete": _("Complete")}, default = "quick")
		self.testtypeEntry = getConfigListEntry(_("Test type"), self.testtype)
		self.list.append(self.testtypeEntry)

		self.loopsfailed = ConfigSelection(choices={"-1": "Every known", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8"}, default = "3")
		self.loopsfailedEntry = getConfigListEntry(_("Stop testing plane after # failed transponders"), self.loopsfailed)
		self.list.append(self.loopsfailedEntry)

		self.loopssuccessful = ConfigSelection(choices={"-1": "Every known", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8"}, default = "1")
		self.loopssuccessfulEntry = getConfigListEntry(_("Stop testing plane after # successful transponders"), self.loopssuccessful)
		self.list.append(self.loopssuccessfulEntry)

		self.log = ConfigYesNo(False)
		if harddiskmanager.HDDCount() > 0:
			self.logEntry = getConfigListEntry(_("Log results to harddisk"), self.log)
			self.list.append(self.logEntry)

		self["config"].list = self.list
		self["config"].l.setList(self.list)

	def keyOK(self):
		print self.testtype.getValue()
		testtype = DiseqcTester.TEST_TYPE_QUICK
		if self.testtype.getValue() == "quick":
			testtype = DiseqcTester.TEST_TYPE_QUICK
		elif self.testtype.getValue() == "random":
			testtype = DiseqcTester.TEST_TYPE_RANDOM
		elif self.testtype.getValue() == "complete":
			testtype = DiseqcTester.TEST_TYPE_COMPLETE
		self.session.open(DiseqcTester, feid = self.feid, test_type = testtype, loopsfailed = int(self.loopsfailed.getValue()), loopssuccessful = int(self.loopssuccessful.getValue()), log = self.log.getValue())

	def keyCancel(self):
		self.close()

	# 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
示例#33
0
	else:
		config.plugins.infopanel_redpanel.selection = ConfigSelection(redSelection, default='1')
		config.plugins.infopanel_redpanel.selectionLong = ConfigSelection(redSelection, default='2')
timer = eTimer()
timer.timeout.get().append(timerEvent)
timer.startLongTimer(1)

choicelist = [('0',_("Audio Selection")),('1',_("Default (Timeshift)")), ('2',_("Toggle Pillarbox <> Pan&Scan")),('3',_("Teletext"))]
config.plugins.infopanel_yellowkey = ConfigSubsection()
if getBoxType() == "dm800":
	config.plugins.infopanel_yellowkey.list = ConfigSelection(default='1', choices = choicelist)
	config.plugins.infopanel_yellowkey.listLong = ConfigSelection(default='1', choices = choicelist)
else:
	config.plugins.infopanel_yellowkey.list = ConfigSelection(default='0', choices = choicelist)
	config.plugins.infopanel_yellowkey.listLong = ConfigSelection(default='0', choices = choicelist)
config.plugins.showinfopanelextensions = ConfigYesNo(default=False)
config.plugins.infopanel_frozencheck = ConfigSubsection()
config.plugins.infopanel_frozencheck.list = ConfigSelection([('0',_("Off")),('1',_("1 min.")), ('5',_("5 min.")),('10',_("10 min.")),('15',_("15 min.")),('30',_("30 min."))])
	
if os.path.isfile("/usr/lib/enigma2/python/Plugins/Extensions/MultiQuickButton/plugin.pyo") is True:
	try:
		from Plugins.Extensions.MultiQuickButton.plugin import *
	except:
		pass

from Screens.CronTimer import *
from Plugins.Extensions.Infopanel.ScriptRunner import *
from Plugins.Extensions.Infopanel.MountManager import *
from Plugins.Extensions.Infopanel.SoftcamPanel import *
from Plugins.Extensions.Infopanel.CamStart import *
from Plugins.Extensions.Infopanel.CamCheck import *
示例#34
0
	def createConfig(self, frontendData):
		defaultSat = {
			"orbpos": 192,
			"system": eDVBFrontendParametersSatellite.System_DVB_S,
			"frequency": 11836,
			"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
			"symbolrate": 27500,
			"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
			"fec": eDVBFrontendParametersSatellite.FEC_Auto,
			"fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
			"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK }
		defaultCab = {
			"frequency": 466,
			"inversion": eDVBFrontendParametersCable.Inversion_Unknown,
			"modulation": eDVBFrontendParametersCable.Modulation_QAM64,
			"fec": eDVBFrontendParametersCable.FEC_Auto,
			"symbolrate": 6900,
			"system": eDVBFrontendParametersCable.System_DVB_C_ANNEX_A }
		defaultTer = {
			"frequency" : 466000,
			"inversion" : eDVBFrontendParametersTerrestrial.Inversion_Unknown,
			"bandwidth" : 7000000,
			"fechigh" : eDVBFrontendParametersTerrestrial.FEC_Auto,
			"feclow" : eDVBFrontendParametersTerrestrial.FEC_Auto,
			"modulation" : eDVBFrontendParametersTerrestrial.Modulation_Auto,
			"transmission_mode" : eDVBFrontendParametersTerrestrial.TransmissionMode_Auto,
			"guard_interval" : eDVBFrontendParametersTerrestrial.GuardInterval_Auto,
			"hierarchy": eDVBFrontendParametersTerrestrial.Hierarchy_Auto,
			"system": eDVBFrontendParametersTerrestrial.System_DVB_T,
			"plp_id": 0 }

		if frontendData is not None:
			ttype = frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S":
				defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
				defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
				defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
				defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
				defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
				if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
					defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
					defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
				else:
					defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
				defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
				defaultSat["orbpos"] = frontendData.get("orbital_position", 0)
			elif ttype == "DVB-C":
				defaultCab["frequency"] = frontendData.get("frequency", 0) / 1000
				defaultCab["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
				defaultCab["inversion"] = frontendData.get("inversion", eDVBFrontendParametersCable.Inversion_Unknown)
				defaultCab["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersCable.FEC_Auto)
				defaultCab["modulation"] = frontendData.get("modulation", eDVBFrontendParametersCable.Modulation_QAM16)
				defaultTer["system"] = frontendData.get("system", eDVBFrontendParametersCable.System_DVB_C_ANNEX_A)
			elif ttype == "DVB-T":
				defaultTer["frequency"] = frontendData.get("frequency", 0)
				defaultTer["inversion"] = frontendData.get("inversion", eDVBFrontendParametersTerrestrial.Inversion_Unknown)
				defaultTer["bandwidth"] = frontendData.get("bandwidth", 7000000)
				defaultTer["fechigh"] = frontendData.get("code_rate_hp", eDVBFrontendParametersTerrestrial.FEC_Auto)
				defaultTer["feclow"] = frontendData.get("code_rate_lp", eDVBFrontendParametersTerrestrial.FEC_Auto)
				defaultTer["modulation"] = frontendData.get("constellation", eDVBFrontendParametersTerrestrial.Modulation_Auto)
				defaultTer["transmission_mode"] = frontendData.get("transmission_mode", eDVBFrontendParametersTerrestrial.TransmissionMode_Auto)
				defaultTer["guard_interval"] = frontendData.get("guard_interval", eDVBFrontendParametersTerrestrial.GuardInterval_Auto)
				defaultTer["hierarchy"] = frontendData.get("hierarchy_information", eDVBFrontendParametersTerrestrial.Hierarchy_Auto)
				defaultTer["system"] = frontendData.get("system", eDVBFrontendParametersTerrestrial.System_DVB_T)

		self.scan_sat = ConfigSubsection()
		self.scan_cab = ConfigSubsection()
		self.scan_ter = ConfigSubsection()

		self.scan_type = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("single_satellite", _("Single satellite")), ("multisat", _("Multisat")), ("multisat_yes", _("Multisat"))])
		self.scan_typecable = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("complete", _("Complete"))])
		self.scan_typeterrestrial = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("complete", _("Complete"))])
		self.scan_clearallservices = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))])
		self.scan_onlyfree = ConfigYesNo(default = False)
		self.scan_networkScan = ConfigYesNo(default = False)

		nim_list = []
		# collect all nims which are *not* set to "nothing"
		for n in nimmanager.nim_slots:
			if n.config_mode == "nothing":
				continue
			if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			if n.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.getValue()))
				if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			nim_list.append((str(n.slot), n.friendly_full_description))

		self.scan_nims = ConfigSelection(choices = nim_list)

		# status
		self.scan_snr = ConfigSlider()
		self.scan_snr.enabled = False
		self.scan_agc = ConfigSlider()
		self.scan_agc.enabled = False
		self.scan_ber = ConfigSlider()
		self.scan_ber.enabled = False

		# sat
		self.scan_sat.system = ConfigSelection(default = defaultSat["system"], choices = [
			(eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S")),
			(eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S2"))])
		self.scan_sat.frequency = ConfigInteger(default = defaultSat["frequency"], limits = (1, 99999))
		self.scan_sat.inversion = ConfigSelection(default = defaultSat["inversion"], choices = [
			(eDVBFrontendParametersSatellite.Inversion_Off, _("Off")),
			(eDVBFrontendParametersSatellite.Inversion_On, _("On")),
			(eDVBFrontendParametersSatellite.Inversion_Unknown, _("Auto"))])
		self.scan_sat.symbolrate = ConfigInteger(default = defaultSat["symbolrate"], limits = (1, 99999))
		self.scan_sat.polarization = ConfigSelection(default = defaultSat["polarization"], choices = [
			(eDVBFrontendParametersSatellite.Polarisation_Horizontal, _("horizontal")),
			(eDVBFrontendParametersSatellite.Polarisation_Vertical, _("vertical")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularLeft, _("circular left")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularRight, _("circular right"))])
		self.scan_sat.fec = ConfigSelection(default = defaultSat["fec"], choices = [
			(eDVBFrontendParametersSatellite.FEC_Auto, _("Auto")),
			(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
			(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
			(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
			(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
			(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
			(eDVBFrontendParametersSatellite.FEC_None, _("None"))])
		self.scan_sat.fec_s2 = ConfigSelection(default = defaultSat["fec_s2"], choices = [
			(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
			(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
			(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
			(eDVBFrontendParametersSatellite.FEC_3_5, "3/5"),
			(eDVBFrontendParametersSatellite.FEC_4_5, "4/5"),
			(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
			(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
			(eDVBFrontendParametersSatellite.FEC_8_9, "8/9"),
			(eDVBFrontendParametersSatellite.FEC_9_10, "9/10")])
		self.scan_sat.modulation = ConfigSelection(default = defaultSat["modulation"], choices = [
			(eDVBFrontendParametersSatellite.Modulation_QPSK, "QPSK"),
			(eDVBFrontendParametersSatellite.Modulation_8PSK, "8PSK")])
		self.scan_sat.rolloff = ConfigSelection(default = defaultSat.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35), choices = [
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_35, "0.35"),
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_25, "0.25"),
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_20, "0.20"),
			(eDVBFrontendParametersSatellite.RollOff_auto, _("Auto"))])
		self.scan_sat.pilot = ConfigSelection(default = defaultSat.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown), choices = [
			(eDVBFrontendParametersSatellite.Pilot_Off, _("Off")),
			(eDVBFrontendParametersSatellite.Pilot_On, _("On")),
			(eDVBFrontendParametersSatellite.Pilot_Unknown, _("Auto"))])

		# cable
		self.scan_cab.frequency = ConfigInteger(default = defaultCab["frequency"], limits = (50, 999))
		self.scan_cab.inversion = ConfigSelection(default = defaultCab["inversion"], choices = [
			(eDVBFrontendParametersCable.Inversion_Off, _("Off")),
			(eDVBFrontendParametersCable.Inversion_On, _("On")),
			(eDVBFrontendParametersCable.Inversion_Unknown, _("Auto"))])
		self.scan_cab.modulation = ConfigSelection(default = defaultCab["modulation"], choices = [
			(eDVBFrontendParametersCable.Modulation_QAM16, "16-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM32, "32-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM64, "64-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM128, "128-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM256, "256-QAM")])
		self.scan_cab.fec = ConfigSelection(default = defaultCab["fec"], choices = [
			(eDVBFrontendParametersCable.FEC_Auto, _("Auto")),
			(eDVBFrontendParametersCable.FEC_1_2, "1/2"),
			(eDVBFrontendParametersCable.FEC_2_3, "2/3"),
			(eDVBFrontendParametersCable.FEC_3_4, "3/4"),
			(eDVBFrontendParametersCable.FEC_5_6, "5/6"),
			(eDVBFrontendParametersCable.FEC_6_7, "6/7"),
			(eDVBFrontendParametersCable.FEC_7_8, "7/8"),
			(eDVBFrontendParametersCable.FEC_8_9, "8/9"),
			(eDVBFrontendParametersCable.FEC_None, _("None"))])
		self.scan_cab.symbolrate = ConfigInteger(default = defaultCab["symbolrate"], limits = (1, 99999))
		self.scan_cab.system = ConfigSelection(default = defaultCab["system"], choices = [
			(eDVBFrontendParametersCable.System_DVB_C_ANNEX_A, _("DVB-C")),
			(eDVBFrontendParametersCable.System_DVB_C_ANNEX_C, _("DVB-C ANNEX C"))])

		# terrestial
		self.scan_ter.frequency = ConfigInteger(default = 466000, limits = (50000, 999000))
		self.scan_ter.inversion = ConfigSelection(default = defaultTer["inversion"], choices = [
			(eDVBFrontendParametersTerrestrial.Inversion_Off, _("Off")),
			(eDVBFrontendParametersTerrestrial.Inversion_On, _("On")),
			(eDVBFrontendParametersTerrestrial.Inversion_Unknown, _("Auto"))])
		# WORKAROUND: we can't use BW-auto
		self.scan_ter.bandwidth = ConfigSelection(default = defaultTer["bandwidth"], choices = [
			(10000000, "10MHz"),
			(8000000, "8MHz"),
			(7000000, "7MHz"),
			(6000000, "6MHz"),
			(5000000, "5MHz"),
			(1712000, "1.712MHz")
			])
		#, (eDVBFrontendParametersTerrestrial.Bandwidth_Auto, _("Auto"))))
		self.scan_ter.fechigh = ConfigSelection(default = defaultTer["fechigh"], choices = [
			(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
			(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
			(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
			(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
			(eDVBFrontendParametersTerrestrial.FEC_6_7, "6/7"),
			(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
			(eDVBFrontendParametersTerrestrial.FEC_8_9, "8/9"),
			(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
		self.scan_ter.feclow = ConfigSelection(default = defaultTer["feclow"], choices = [
			(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
			(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
			(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
			(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
			(eDVBFrontendParametersTerrestrial.FEC_6_7, "6/7"),
			(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
			(eDVBFrontendParametersTerrestrial.FEC_8_9, "8/9"),
			(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
		self.scan_ter.modulation = ConfigSelection(default = defaultTer["modulation"], choices = [
			(eDVBFrontendParametersTerrestrial.Modulation_QPSK, "QPSK"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM16, "QAM16"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM64, "QAM64"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM256, "QAM256"),
			(eDVBFrontendParametersTerrestrial.Modulation_Auto, _("Auto"))])
		self.scan_ter.transmission = ConfigSelection(default = defaultTer["transmission_mode"], choices = [
			(eDVBFrontendParametersTerrestrial.TransmissionMode_2k, "2K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_4k, "4K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_8k, "8K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_Auto, _("Auto"))])
		self.scan_ter.guard = ConfigSelection(default = defaultTer["guard_interval"], choices = [
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_32, "1/32"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_16, "1/16"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_8, "1/8"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_4, "1/4"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_Auto, _("Auto"))])
		self.scan_ter.hierarchy = ConfigSelection(default = defaultTer["hierarchy"], choices = [
			(eDVBFrontendParametersTerrestrial.Hierarchy_None, _("None")),
			(eDVBFrontendParametersTerrestrial.Hierarchy_1, "1"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_2, "2"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_4, "4"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_Auto, _("Auto"))])
		self.scan_ter.system = ConfigSelection(default = defaultTer["system"], choices = [
			(eDVBFrontendParametersTerrestrial.System_DVB_T, _("DVB-T")),
			(eDVBFrontendParametersTerrestrial.System_DVB_T2, _("DVB-T2"))])
		self.scan_ter.plp_id = ConfigInteger(default = defaultTer["plp_id"], limits = (0, 255))

		self.scan_scansat = {}
		for sat in nimmanager.satList:
			#print sat[1]
			self.scan_scansat[sat[0]] = ConfigYesNo(default = False)

		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot]))
			else:
				self.scan_satselection.append(None)

		return True
	def __init__(self, session):
		Screen.__init__(self, session)

		self.logfile			= open("/tmp/satscan.log", "w+", 0)
		self.executable			= None
		self.vuplus_quirks		= False

		for tryname in ("avl_azbox_blindscan", "avl_xtrend_blindscan", "vuplus_blindscan"):
			print "try:", tryname

			try:
				subprocess.check_call((tryname))
				self.executable = tryname
				break
			except OSError:
				print tryname + ": OSError"
				None
			except subprocess.CalledProcessError:
				# vuplus_blindscan returns -1 when called with no arguments
				print tryname + ": CalledProcessError"
				self.executable = tryname
				break

		print "executable = ", self.executable

		if self.executable == "vuplus_blindscan":
			self.vuplus_quirks = True

		self.scan_circular		= ConfigYesNo(default = False)
		self.scan_transponders	= ConfigYesNo(default = False)
		self.scan_clearservices	= ConfigYesNo(default = False)
		self.scan_fta			= ConfigYesNo(default = False)

		self.current_service		= self.session.nav.getCurrentlyPlayingServiceReference()
		self.all_pos_per_dvbs_nim	= []

		nimmanager.enumerateNIMs()

		for nim_slot in nimmanager.nim_slots:
			if nim_slot.isCompatible("DVB-S"):
				self.all_pos_per_dvbs_nim.append(nimmanager.getSatListForNim(nim_slot.slot))
			else:
				self.all_pos_per_dvbs_nim.append(None)

		#print "*** all_pos_per_dvbs_nim: ", self.all_pos_per_dvbs_nim

		self.current_orb_pos = 192
		current_service = self.session.nav.getCurrentService()

		if current_service is not None:
			feinfo = current_service.frontendInfo()
			if feinfo is not None:
				fedata = feinfo.getAll(True)
				if fedata.get("tuner_type", "UNKNOWN") == "DVB-S":
					self.current_orb_pos = fedata.get("orbital_position", 0);

		selectable_nims = []
		for nim in nimmanager.nim_slots:
			if nim.config_mode == "nothing":
				continue
			if nim.config_mode == "advanced" and len(nimmanager.getSatListForNim(nim.slot)) < 1:
				continue
			if nim.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(nim.slot_id, int(nim.config.connectedTo.value))
				if nim.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			if nim.isCompatible("DVB-S"):
				selectable_nims.append((str(nim.slot), nim.friendly_full_description))

		self.select_nim = ConfigSelection(choices = selectable_nims)

		self.positions_config_list = []
		for nim_slot in nimmanager.nim_slots:
			if nim_slot.isCompatible("DVB-S"):
				self.positions_config_list.append(getConfigSatlist(self.current_orb_pos, self.all_pos_per_dvbs_nim[nim_slot.slot]))

		self.config_list = []
		ConfigListScreen.__init__(self, self.config_list)

		if self.select_nim.value != None and self.select_nim.value != "" :
			self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "ColorActions" ],
			{
				"red":		self.keyCancel,
				"green":	self.keyGo,
				"ok":		self.keyGo,
				"cancel":	self.keyCancel,
			}, -2)

			self["key_red"]		= StaticText(_("Exit"))
			self["key_green"]	= StaticText(_("Start"))

			if self.vuplus_quirks:
				disclaimer = _("WARNING! Blindscan may make the tuner malfunction on a VU+ receiver. A reboot afterwards may be required to return to proper tuner function.\n\n")
			else:
				disclaimer = ""

			self["text"] = Label(disclaimer + _("Press OK to start scanning"))

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

			self["key_red"]		= StaticText(_("Exit"))
			self["key_green"]	= StaticText(" ")
			self["text"]		= Label(_("Tuner not set up, can't scan"))
示例#36
0
	def __init__(self, session, infobar):
		Screen.__init__(self, session)
		self.infobar = infobar or self.session.infobar
		self.wait = eTimer()
		self.wait.timeout.get().append(self.resyncSubtitles)
		self.service = self.session.nav.getCurrentlyPlayingServiceReference()
		servicepath = self.service and self.service.getPath()
		if servicepath and servicepath.startswith("/") and self.service.toString().startswith("1:"):
			info = eServiceCenter.getInstance().info(self.service)
			self.service_string = info and info.getInfoString(self.service, iServiceInformation.sServiceref)
		else:
			self.service_string = self.service.toString()
		self.center_dvb_subs = ConfigYesNo(default = (eDVBDB.getInstance().getFlag(eServiceReference(self.service_string)) & self.FLAG_CENTER_DVB_SUBS) and True)
		self.center_dvb_subs.addNotifier(self.setCenterDvbSubs)
		self["videofps"] = Label("")

		sub = self.infobar.selected_subtitle
		if sub[0] == 0:  # dvb
			menu = [
				getConfigMenuItem("config.subtitles.dvb_subtitles_yellow"),
				getConfigMenuItem("config.subtitles.dvb_subtitles_backtrans"),
				getConfigMenuItem("config.subtitles.dvb_subtitles_original_position"),
				(_("Center DVB subtitles"), self.center_dvb_subs),
				getConfigMenuItem("config.subtitles.subtitle_position"),
				getConfigMenuItem("config.subtitles.subtitle_bad_timing_delay"),
				getConfigMenuItem("config.subtitles.subtitle_noPTSrecordingdelay"),
			]
		elif sub[0] == 1: # teletext
			menu = [
				getConfigMenuItem("config.subtitles.ttx_subtitle_colors"),
				getConfigMenuItem("config.subtitles.ttx_subtitle_original_position"),
				getConfigMenuItem("config.subtitles.subtitle_fontsize"),
				getConfigMenuItem("config.subtitles.subtitle_position"),
				getConfigMenuItem("config.subtitles.subtitle_rewrap"),
				getConfigMenuItem("config.subtitles.subtitle_borderwidth"),
				getConfigMenuItem("config.subtitles.showbackground"),
				getConfigMenuItem("config.subtitles.subtitle_alignment"),
				getConfigMenuItem("config.subtitles.subtitle_bad_timing_delay"),
				getConfigMenuItem("config.subtitles.subtitle_noPTSrecordingdelay"),
			]
		else: 		# pango
			menu = [
				getConfigMenuItem("config.subtitles.pango_subtitles_delay"),
				getConfigMenuItem("config.subtitles.pango_subtitle_colors"),
				getConfigMenuItem("config.subtitles.pango_subtitle_fontswitch"),
				getConfigMenuItem("config.subtitles.colourise_dialogs"),
				getConfigMenuItem("config.subtitles.subtitle_fontsize"),
				getConfigMenuItem("config.subtitles.subtitle_position"),
				getConfigMenuItem("config.subtitles.subtitle_alignment"),
				getConfigMenuItem("config.subtitles.subtitle_rewrap"),
				getConfigMenuItem("config.subtitles.subtitle_borderwidth"),
				getConfigMenuItem("config.subtitles.showbackground"),
				getConfigMenuItem("config.subtitles.pango_subtitles_fps"),
			]
			self["videofps"].setText(_("Video: %s fps") % (self.getFps().rstrip(".000")))

		ConfigListScreen.__init__(self, menu, self.session, on_change = self.changedEntry)

		self["actions"] = NumberActionMap(["SetupActions"],
		{
			"cancel": self.cancel,
			"ok": self.ok,
		},-2)

		self.onLayoutFinish.append(self.layoutFinished)
示例#37
0
import Components.ClientMode
Components.ClientMode.InitClientMode()

profile("SetupDevices")
import Components.SetupDevices
Components.SetupDevices.InitSetupDevices()

profile("SimpleSummary")
from Screens import InfoBar
from Screens.SimpleSummary import SimpleSummary

from sys import stdout

profile("Bouquets")
from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, NoSave
config.misc.load_unlinked_userbouquets = ConfigYesNo(default=True)


def setLoadUnlinkedUserbouquets(configElement):
    enigma.eDVBDB.getInstance().setLoadUnlinkedUserbouquets(
        configElement.value)


config.misc.load_unlinked_userbouquets.addNotifier(setLoadUnlinkedUserbouquets)
if config.clientmode.enabled.value == False:
    enigma.eDVBDB.getInstance().reloadBouquets()

profile("ParentalControl")
import Components.ParentalControl
Components.ParentalControl.InitParentalControl()
示例#38
0
from Tools.LoadPixmap import LoadPixmap

from xml.etree.cElementTree import parse as cet_parse
try:
    from xml.etree.cElementTree import ParseError
except ImportError as ie:
    ParseError = SyntaxError
from Tools.XMLTools import stringToXML

from shutil import copyfile, Error

XML_CONFIG = "/etc/enigma2/pluginsort.xml"
DEBUG = False

config.plugins.pluginsort = ConfigSubsection()
config.plugins.pluginsort.show_help = ConfigYesNo(default=True)


def MyPluginEntryComponent(plugin, backcolor_sel=None):
    if plugin.icon is None:
        png = LoadPixmap(
            resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/plugin.png"))
    else:
        png = plugin.icon

    return [
        plugin,
        plugin.name,
        plugin.description,
        png,
        #plugin, backcolor_sel, plugin.name, plugin.description, png,
示例#39
0
class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport):
	def __init__(self, session):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Manual Scan"))

		self.finished_cb = None
		self.updateSatList()
		self.service = session.nav.getCurrentService()
		self.feinfo = None
		self.networkid = 0
		frontendData = None
		if self.service is not None:
			self.feinfo = self.service.frontendInfo()
			frontendData = self.feinfo and self.feinfo.getAll(True)

		self.createConfig(frontendData)

		del self.feinfo
		del self.service

		self.session.postScanService = session.nav.getCurrentlyPlayingServiceOrGroup()

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Scan"))

		self["actions"] = NumberActionMap(["SetupActions", "MenuActions", "ColorActions"],
		{
			"ok": self.keyGo,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"red": self.keyCancel,
			"green": self.keyGo,
			"menu": self.doCloseRecursive,
		}, -2)

		self.statusTimer = eTimer()
		self.statusTimer.callback.append(self.updateStatus)
		#self.statusTimer.start(5000, True)

		self.list = []
		ConfigListScreen.__init__(self, self.list)
		self["header"] = Label(_("Manual Scan"))
		if not self.scan_nims.getValue() == "":
			self.createSetup()
			self["introduction"] = Label(_("Press OK to start the scan"))
		else:
			self["introduction"] = Label(_("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."))

	def runAsync(self, finished_cb):
		self.finished_cb = finished_cb
		self.keyGo()

	def updateSatList(self):
		self.satList = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.satList.append(nimmanager.getSatListForNim(slot.slot))
			else:
				self.satList.append(None)

	def createSetup(self):
		self.list = []
		self.multiscanlist = []
		index_to_scan = int(self.scan_nims.getValue())
		print "ID: ", index_to_scan

		self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
		self.list.append(self.tunerEntry)

		if self.scan_nims == [ ]:
			return

		self.typeOfScanEntry = None
		self.systemEntry = None
		self.modulationEntry = None
		nim = nimmanager.nim_slots[index_to_scan]
		if nim.isCompatible("DVB-S"):
			self.typeOfScanEntry = getConfigListEntry(_("Type of scan"), self.scan_type)
			self.list.append(self.typeOfScanEntry)
		elif nim.isCompatible("DVB-C"):
			self.typeOfScanEntry = getConfigListEntry(_("Type of scan"), self.scan_typecable)
			self.list.append(self.typeOfScanEntry)
		elif nim.isCompatible("DVB-T"):
			self.typeOfScanEntry = getConfigListEntry(_("Type of scan"), self.scan_typeterrestrial)
			self.list.append(self.typeOfScanEntry)

		self.scan_networkScan.setValue(False)
		if nim.isCompatible("DVB-S"):
			if self.scan_type.getValue() == "single_transponder":
				self.updateSatList()
				if nim.isCompatible("DVB-S2"):
					self.systemEntry = getConfigListEntry(_('System'), self.scan_sat.system)
					self.list.append(self.systemEntry)
				else:
					# downgrade to dvb-s, in case a -s2 config was active
					self.scan_sat.system.setValue(eDVBFrontendParametersSatellite.System_DVB_S)
				self.list.append(getConfigListEntry(_('Satellite'), self.scan_satselection[index_to_scan]))
				self.list.append(getConfigListEntry(_('Frequency'), self.scan_sat.frequency))
				self.list.append(getConfigListEntry(_('Inversion'), self.scan_sat.inversion))
				self.list.append(getConfigListEntry(_('Symbol rate'), self.scan_sat.symbolrate))
				self.list.append(getConfigListEntry(_('Polarization'), self.scan_sat.polarization))
				if self.scan_sat.system.getValue() == eDVBFrontendParametersSatellite.System_DVB_S:
					self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec))
				elif self.scan_sat.system.getValue() == eDVBFrontendParametersSatellite.System_DVB_S2:
					self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec_s2))
					self.modulationEntry = getConfigListEntry(_('Modulation'), self.scan_sat.modulation)
					self.list.append(self.modulationEntry)
					self.list.append(getConfigListEntry(_('Roll-off'), self.scan_sat.rolloff))
					self.list.append(getConfigListEntry(_('Pilot'), self.scan_sat.pilot))
			elif self.scan_type.getValue() == "single_satellite":
				self.updateSatList()
				print self.scan_satselection[index_to_scan]
				self.list.append(getConfigListEntry(_("Satellite"), self.scan_satselection[index_to_scan]))
				self.scan_networkScan.setValue(True)
			elif self.scan_type.getValue().find("multisat") != -1:
				tlist = []
				SatList = nimmanager.getSatListForNim(index_to_scan)
				for x in SatList:
					if self.Satexists(tlist, x[0]) == 0:
						tlist.append(x[0])
						sat = ConfigEnableDisable(default = self.scan_type.getValue().find("_yes") != -1 and True or False)
						configEntry = getConfigListEntry(nimmanager.getSatDescription(x[0]), sat)
						self.list.append(configEntry)
						self.multiscanlist.append((x[0], sat))
				self.scan_networkScan.setValue(True)
		elif nim.isCompatible("DVB-C"):
			if self.scan_typecable.getValue() == "single_transponder":
				self.list.append(getConfigListEntry(_("Frequency"), self.scan_cab.frequency))
				self.list.append(getConfigListEntry(_("Inversion"), self.scan_cab.inversion))
				self.list.append(getConfigListEntry(_("Symbol rate"), self.scan_cab.symbolrate))
				self.list.append(getConfigListEntry(_("Modulation"), self.scan_cab.modulation))
				self.list.append(getConfigListEntry(_("FEC"), self.scan_cab.fec))
			if config.Nims[index_to_scan].cable.scan_networkid.getValue():
				self.networkid = config.Nims[index_to_scan].cable.scan_networkid.getValue()
				self.scan_networkScan.setValue(True)
		elif nim.isCompatible("DVB-T"):
			if self.scan_typeterrestrial.getValue() == "single_transponder":
				if nim.isCompatible("DVB-T2"):
					self.systemEntry = getConfigListEntry(_('System'), self.scan_ter.system)
					self.list.append(self.systemEntry)
				else:
					self.scan_ter.system.value = eDVBFrontendParametersTerrestrial.System_DVB_T
				self.list.append(getConfigListEntry(_("Frequency"), self.scan_ter.frequency))
				self.list.append(getConfigListEntry(_("Inversion"), self.scan_ter.inversion))
				self.list.append(getConfigListEntry(_("Bandwidth"), self.scan_ter.bandwidth))
				self.list.append(getConfigListEntry(_("Code rate HP"), self.scan_ter.fechigh))
				self.list.append(getConfigListEntry(_("Code rate LP"), self.scan_ter.feclow))
				self.list.append(getConfigListEntry(_("Modulation"), self.scan_ter.modulation))
				self.list.append(getConfigListEntry(_("Transmission mode"), self.scan_ter.transmission))
				self.list.append(getConfigListEntry(_("Guard interval"), self.scan_ter.guard))
				self.list.append(getConfigListEntry(_("Hierarchy info"), self.scan_ter.hierarchy))
				if self.scan_ter.system.value == eDVBFrontendParametersTerrestrial.System_DVB_T2:
					self.list.append(getConfigListEntry(_('PLP ID'), self.scan_ter.plp_id))
		self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan))
		self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices))
		self.list.append(getConfigListEntry(_("Only free scan"), self.scan_onlyfree))
		self["config"].list = self.list
		self["config"].l.setList(self.list)

	def Satexists(self, tlist, pos):
		for x in tlist:
			if x == pos:
				return 1
		return 0

	def newConfig(self):
		cur = self["config"].getCurrent()
		print "cur is", cur
		if cur == self.typeOfScanEntry or \
			cur == self.tunerEntry or \
			cur == self.systemEntry or \
			(self.modulationEntry and self.systemEntry[1].getValue() == eDVBFrontendParametersSatellite.System_DVB_S2 and cur == self.modulationEntry):
			self.createSetup()

	def createConfig(self, frontendData):
		defaultSat = {
			"orbpos": 192,
			"system": eDVBFrontendParametersSatellite.System_DVB_S,
			"frequency": 11836,
			"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
			"symbolrate": 27500,
			"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
			"fec": eDVBFrontendParametersSatellite.FEC_Auto,
			"fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
			"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK }
		defaultCab = {
			"frequency": 466,
			"inversion": eDVBFrontendParametersCable.Inversion_Unknown,
			"modulation": eDVBFrontendParametersCable.Modulation_QAM64,
			"fec": eDVBFrontendParametersCable.FEC_Auto,
			"symbolrate": 6900,
			"system": eDVBFrontendParametersCable.System_DVB_C_ANNEX_A }
		defaultTer = {
			"frequency" : 466000,
			"inversion" : eDVBFrontendParametersTerrestrial.Inversion_Unknown,
			"bandwidth" : 7000000,
			"fechigh" : eDVBFrontendParametersTerrestrial.FEC_Auto,
			"feclow" : eDVBFrontendParametersTerrestrial.FEC_Auto,
			"modulation" : eDVBFrontendParametersTerrestrial.Modulation_Auto,
			"transmission_mode" : eDVBFrontendParametersTerrestrial.TransmissionMode_Auto,
			"guard_interval" : eDVBFrontendParametersTerrestrial.GuardInterval_Auto,
			"hierarchy": eDVBFrontendParametersTerrestrial.Hierarchy_Auto,
			"system": eDVBFrontendParametersTerrestrial.System_DVB_T,
			"plp_id": 0 }

		if frontendData is not None:
			ttype = frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S":
				defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
				defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
				defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
				defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
				defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
				if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
					defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
					defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
				else:
					defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
				defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
				defaultSat["orbpos"] = frontendData.get("orbital_position", 0)
			elif ttype == "DVB-C":
				defaultCab["frequency"] = frontendData.get("frequency", 0) / 1000
				defaultCab["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
				defaultCab["inversion"] = frontendData.get("inversion", eDVBFrontendParametersCable.Inversion_Unknown)
				defaultCab["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersCable.FEC_Auto)
				defaultCab["modulation"] = frontendData.get("modulation", eDVBFrontendParametersCable.Modulation_QAM16)
				defaultTer["system"] = frontendData.get("system", eDVBFrontendParametersCable.System_DVB_C_ANNEX_A)
			elif ttype == "DVB-T":
				defaultTer["frequency"] = frontendData.get("frequency", 0)
				defaultTer["inversion"] = frontendData.get("inversion", eDVBFrontendParametersTerrestrial.Inversion_Unknown)
				defaultTer["bandwidth"] = frontendData.get("bandwidth", 7000000)
				defaultTer["fechigh"] = frontendData.get("code_rate_hp", eDVBFrontendParametersTerrestrial.FEC_Auto)
				defaultTer["feclow"] = frontendData.get("code_rate_lp", eDVBFrontendParametersTerrestrial.FEC_Auto)
				defaultTer["modulation"] = frontendData.get("constellation", eDVBFrontendParametersTerrestrial.Modulation_Auto)
				defaultTer["transmission_mode"] = frontendData.get("transmission_mode", eDVBFrontendParametersTerrestrial.TransmissionMode_Auto)
				defaultTer["guard_interval"] = frontendData.get("guard_interval", eDVBFrontendParametersTerrestrial.GuardInterval_Auto)
				defaultTer["hierarchy"] = frontendData.get("hierarchy_information", eDVBFrontendParametersTerrestrial.Hierarchy_Auto)
				defaultTer["system"] = frontendData.get("system", eDVBFrontendParametersTerrestrial.System_DVB_T)

		self.scan_sat = ConfigSubsection()
		self.scan_cab = ConfigSubsection()
		self.scan_ter = ConfigSubsection()

		self.scan_type = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("single_satellite", _("Single satellite")), ("multisat", _("Multisat")), ("multisat_yes", _("Multisat"))])
		self.scan_typecable = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("complete", _("Complete"))])
		self.scan_typeterrestrial = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("complete", _("Complete"))])
		self.scan_clearallservices = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))])
		self.scan_onlyfree = ConfigYesNo(default = False)
		self.scan_networkScan = ConfigYesNo(default = False)

		nim_list = []
		# collect all nims which are *not* set to "nothing"
		for n in nimmanager.nim_slots:
			if n.config_mode == "nothing":
				continue
			if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			if n.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.getValue()))
				if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			nim_list.append((str(n.slot), n.friendly_full_description))

		self.scan_nims = ConfigSelection(choices = nim_list)

		# status
		self.scan_snr = ConfigSlider()
		self.scan_snr.enabled = False
		self.scan_agc = ConfigSlider()
		self.scan_agc.enabled = False
		self.scan_ber = ConfigSlider()
		self.scan_ber.enabled = False

		# sat
		self.scan_sat.system = ConfigSelection(default = defaultSat["system"], choices = [
			(eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S")),
			(eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S2"))])
		self.scan_sat.frequency = ConfigInteger(default = defaultSat["frequency"], limits = (1, 99999))
		self.scan_sat.inversion = ConfigSelection(default = defaultSat["inversion"], choices = [
			(eDVBFrontendParametersSatellite.Inversion_Off, _("Off")),
			(eDVBFrontendParametersSatellite.Inversion_On, _("On")),
			(eDVBFrontendParametersSatellite.Inversion_Unknown, _("Auto"))])
		self.scan_sat.symbolrate = ConfigInteger(default = defaultSat["symbolrate"], limits = (1, 99999))
		self.scan_sat.polarization = ConfigSelection(default = defaultSat["polarization"], choices = [
			(eDVBFrontendParametersSatellite.Polarisation_Horizontal, _("horizontal")),
			(eDVBFrontendParametersSatellite.Polarisation_Vertical, _("vertical")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularLeft, _("circular left")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularRight, _("circular right"))])
		self.scan_sat.fec = ConfigSelection(default = defaultSat["fec"], choices = [
			(eDVBFrontendParametersSatellite.FEC_Auto, _("Auto")),
			(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
			(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
			(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
			(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
			(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
			(eDVBFrontendParametersSatellite.FEC_None, _("None"))])
		self.scan_sat.fec_s2 = ConfigSelection(default = defaultSat["fec_s2"], choices = [
			(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
			(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
			(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
			(eDVBFrontendParametersSatellite.FEC_3_5, "3/5"),
			(eDVBFrontendParametersSatellite.FEC_4_5, "4/5"),
			(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
			(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
			(eDVBFrontendParametersSatellite.FEC_8_9, "8/9"),
			(eDVBFrontendParametersSatellite.FEC_9_10, "9/10")])
		self.scan_sat.modulation = ConfigSelection(default = defaultSat["modulation"], choices = [
			(eDVBFrontendParametersSatellite.Modulation_QPSK, "QPSK"),
			(eDVBFrontendParametersSatellite.Modulation_8PSK, "8PSK")])
		self.scan_sat.rolloff = ConfigSelection(default = defaultSat.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35), choices = [
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_35, "0.35"),
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_25, "0.25"),
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_20, "0.20"),
			(eDVBFrontendParametersSatellite.RollOff_auto, _("Auto"))])
		self.scan_sat.pilot = ConfigSelection(default = defaultSat.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown), choices = [
			(eDVBFrontendParametersSatellite.Pilot_Off, _("Off")),
			(eDVBFrontendParametersSatellite.Pilot_On, _("On")),
			(eDVBFrontendParametersSatellite.Pilot_Unknown, _("Auto"))])

		# cable
		self.scan_cab.frequency = ConfigInteger(default = defaultCab["frequency"], limits = (50, 999))
		self.scan_cab.inversion = ConfigSelection(default = defaultCab["inversion"], choices = [
			(eDVBFrontendParametersCable.Inversion_Off, _("Off")),
			(eDVBFrontendParametersCable.Inversion_On, _("On")),
			(eDVBFrontendParametersCable.Inversion_Unknown, _("Auto"))])
		self.scan_cab.modulation = ConfigSelection(default = defaultCab["modulation"], choices = [
			(eDVBFrontendParametersCable.Modulation_QAM16, "16-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM32, "32-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM64, "64-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM128, "128-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM256, "256-QAM")])
		self.scan_cab.fec = ConfigSelection(default = defaultCab["fec"], choices = [
			(eDVBFrontendParametersCable.FEC_Auto, _("Auto")),
			(eDVBFrontendParametersCable.FEC_1_2, "1/2"),
			(eDVBFrontendParametersCable.FEC_2_3, "2/3"),
			(eDVBFrontendParametersCable.FEC_3_4, "3/4"),
			(eDVBFrontendParametersCable.FEC_5_6, "5/6"),
			(eDVBFrontendParametersCable.FEC_6_7, "6/7"),
			(eDVBFrontendParametersCable.FEC_7_8, "7/8"),
			(eDVBFrontendParametersCable.FEC_8_9, "8/9"),
			(eDVBFrontendParametersCable.FEC_None, _("None"))])
		self.scan_cab.symbolrate = ConfigInteger(default = defaultCab["symbolrate"], limits = (1, 99999))
		self.scan_cab.system = ConfigSelection(default = defaultCab["system"], choices = [
			(eDVBFrontendParametersCable.System_DVB_C_ANNEX_A, _("DVB-C")),
			(eDVBFrontendParametersCable.System_DVB_C_ANNEX_C, _("DVB-C ANNEX C"))])

		# terrestial
		self.scan_ter.frequency = ConfigInteger(default = 466000, limits = (50000, 999000))
		self.scan_ter.inversion = ConfigSelection(default = defaultTer["inversion"], choices = [
			(eDVBFrontendParametersTerrestrial.Inversion_Off, _("Off")),
			(eDVBFrontendParametersTerrestrial.Inversion_On, _("On")),
			(eDVBFrontendParametersTerrestrial.Inversion_Unknown, _("Auto"))])
		# WORKAROUND: we can't use BW-auto
		self.scan_ter.bandwidth = ConfigSelection(default = defaultTer["bandwidth"], choices = [
			(10000000, "10MHz"),
			(8000000, "8MHz"),
			(7000000, "7MHz"),
			(6000000, "6MHz"),
			(5000000, "5MHz"),
			(1712000, "1.712MHz")
			])
		#, (eDVBFrontendParametersTerrestrial.Bandwidth_Auto, _("Auto"))))
		self.scan_ter.fechigh = ConfigSelection(default = defaultTer["fechigh"], choices = [
			(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
			(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
			(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
			(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
			(eDVBFrontendParametersTerrestrial.FEC_6_7, "6/7"),
			(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
			(eDVBFrontendParametersTerrestrial.FEC_8_9, "8/9"),
			(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
		self.scan_ter.feclow = ConfigSelection(default = defaultTer["feclow"], choices = [
			(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
			(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
			(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
			(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
			(eDVBFrontendParametersTerrestrial.FEC_6_7, "6/7"),
			(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
			(eDVBFrontendParametersTerrestrial.FEC_8_9, "8/9"),
			(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
		self.scan_ter.modulation = ConfigSelection(default = defaultTer["modulation"], choices = [
			(eDVBFrontendParametersTerrestrial.Modulation_QPSK, "QPSK"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM16, "QAM16"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM64, "QAM64"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM256, "QAM256"),
			(eDVBFrontendParametersTerrestrial.Modulation_Auto, _("Auto"))])
		self.scan_ter.transmission = ConfigSelection(default = defaultTer["transmission_mode"], choices = [
			(eDVBFrontendParametersTerrestrial.TransmissionMode_2k, "2K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_4k, "4K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_8k, "8K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_Auto, _("Auto"))])
		self.scan_ter.guard = ConfigSelection(default = defaultTer["guard_interval"], choices = [
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_32, "1/32"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_16, "1/16"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_8, "1/8"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_4, "1/4"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_Auto, _("Auto"))])
		self.scan_ter.hierarchy = ConfigSelection(default = defaultTer["hierarchy"], choices = [
			(eDVBFrontendParametersTerrestrial.Hierarchy_None, _("None")),
			(eDVBFrontendParametersTerrestrial.Hierarchy_1, "1"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_2, "2"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_4, "4"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_Auto, _("Auto"))])
		self.scan_ter.system = ConfigSelection(default = defaultTer["system"], choices = [
			(eDVBFrontendParametersTerrestrial.System_DVB_T, _("DVB-T")),
			(eDVBFrontendParametersTerrestrial.System_DVB_T2, _("DVB-T2"))])
		self.scan_ter.plp_id = ConfigInteger(default = defaultTer["plp_id"], limits = (0, 255))

		self.scan_scansat = {}
		for sat in nimmanager.satList:
			#print sat[1]
			self.scan_scansat[sat[0]] = ConfigYesNo(default = False)

		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot]))
			else:
				self.scan_satselection.append(None)

		return True

	def keyLeft(self):
		ConfigListScreen.keyLeft(self)
		self.newConfig()

	def keyRight(self):
		ConfigListScreen.keyRight(self)
		self.newConfig()

	def updateStatus(self):
		print "updatestatus"

	def addSatTransponder(self, tlist, frequency, symbol_rate, polarisation, fec, inversion, orbital_position, system, modulation, rolloff, pilot):
		print "Add Sat: frequ: " + str(frequency) + " symbol: " + str(symbol_rate) + " pol: " + str(polarisation) + " fec: " + str(fec) + " inversion: " + str(inversion) + " modulation: " + str(modulation) + " system: " + str(system) + " rolloff" + str(rolloff) + " pilot" + str(pilot)
		print "orbpos: " + str(orbital_position)
		parm = eDVBFrontendParametersSatellite()
		parm.modulation = modulation
		parm.system = system
		parm.frequency = frequency * 1000
		parm.symbol_rate = symbol_rate * 1000
		parm.polarisation = polarisation
		parm.fec = fec
		parm.inversion = inversion
		parm.orbital_position = orbital_position
		parm.rolloff = rolloff
		parm.pilot = pilot
		tlist.append(parm)

	def addCabTransponder(self, tlist, frequency, symbol_rate, modulation, fec, inversion):
		print "Add Cab: frequ: " + str(frequency) + " symbol: " + str(symbol_rate) + " pol: " + str(modulation) + " fec: " + str(fec) + " inversion: " + str(inversion)
		parm = eDVBFrontendParametersCable()
		parm.frequency = frequency * 1000
		parm.symbol_rate = symbol_rate * 1000
		parm.modulation = modulation
		parm.fec = fec
		parm.inversion = inversion
		tlist.append(parm)

	def addTerTransponder(self, tlist, *args, **kwargs):
		tlist.append(buildTerTransponder(*args, **kwargs))

	def keyGo(self):
		infoBarInstance = InfoBar.instance
		if infoBarInstance:
			infoBarInstance.checkTimeshiftRunning(self.keyGoCheckTimeshiftCallback)
		else:
			self.keyGoCheckTimeshiftCallback(True)

	def keyGoCheckTimeshiftCallback(self, answer):
		if not answer or self.scan_nims.value == "":
			return
		tlist = []
		flags = None
		startScan = True
		removeAll = True
		index_to_scan = int(self.scan_nims.getValue())

		if self.scan_nims == [ ]:
			self.session.open(MessageBox, _("No tuner is enabled!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR)
			return

		nim = nimmanager.nim_slots[index_to_scan]
		print "nim", nim.slot
		if nim.isCompatible("DVB-S"):
			print "is compatible with DVB-S"
			if self.scan_type.getValue() == "single_transponder":
				# these lists are generated for each tuner, so this has work.
				assert len(self.satList) > index_to_scan
				assert len(self.scan_satselection) > index_to_scan

				nimsats = self.satList[index_to_scan]
				selsatidx = self.scan_satselection[index_to_scan].index

				# however, the satList itself could be empty. in that case, "index" is 0 (for "None").
				if len(nimsats):
					orbpos = nimsats[selsatidx][0]
					if self.scan_sat.system.getValue() == eDVBFrontendParametersSatellite.System_DVB_S:
						fec = self.scan_sat.fec.getValue()
					else:
						fec = self.scan_sat.fec_s2.getValue()
					print "add sat transponder"
					self.addSatTransponder(tlist, self.scan_sat.frequency.getValue(),
								self.scan_sat.symbolrate.getValue(),
								self.scan_sat.polarization.getValue(),
								fec,
								self.scan_sat.inversion.getValue(),
								orbpos,
								self.scan_sat.system.getValue(),
								self.scan_sat.modulation.getValue(),
								self.scan_sat.rolloff.getValue(),
								self.scan_sat.pilot.getValue())
				removeAll = False
			elif self.scan_type.getValue() == "single_satellite":
				sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
				getInitialTransponderList(tlist, sat[0])
			elif self.scan_type.getValue().find("multisat") != -1:
				SatList = nimmanager.getSatListForNim(index_to_scan)
				for x in self.multiscanlist:
					if x[1].getValue():
						print "   " + str(x[0])
						getInitialTransponderList(tlist, x[0])

		elif nim.isCompatible("DVB-C"):
			if self.scan_typecable.getValue() == "single_transponder":
				self.addCabTransponder(tlist, self.scan_cab.frequency.getValue(),
											  self.scan_cab.symbolrate.getValue(),
											  self.scan_cab.modulation.getValue(),
											  self.scan_cab.fec.getValue(),
											  self.scan_cab.inversion.getValue())
				removeAll = False
			elif self.scan_typecable.getValue() == "complete":
				if config.Nims[index_to_scan].cable.scan_type.getValue() == "provider":
					getInitialCableTransponderList(tlist, index_to_scan)
				else:
					startScan = False

		elif nim.isCompatible("DVB-T"):
			if self.scan_typeterrestrial.getValue() == "single_transponder":
				self.addTerTransponder(tlist,
						self.scan_ter.frequency.getValue() * 1000,
						inversion = self.scan_ter.inversion.getValue(),
						bandwidth = self.scan_ter.bandwidth.getValue(),
						fechigh = self.scan_ter.fechigh.getValue(),
						feclow = self.scan_ter.feclow.getValue(),
						modulation = self.scan_ter.modulation.getValue(),
						transmission = self.scan_ter.transmission.getValue(),
						guard = self.scan_ter.guard.getValue(),
						hierarchy = self.scan_ter.hierarchy.getValue(),
						system = self.scan_ter.system.getValue(),
						plpid = self.scan_ter.plp_id.getValue())
				removeAll = False
			elif self.scan_typeterrestrial.getValue() == "complete":
				getInitialTerrestrialTransponderList(tlist, nimmanager.getTerrestrialDescription(index_to_scan))

		flags = self.scan_networkScan.getValue() and eComponentScan.scanNetworkSearch or 0

		tmp = self.scan_clearallservices.getValue()
		if tmp == "yes":
			flags |= eComponentScan.scanRemoveServices
		elif tmp == "yes_hold_feeds":
			flags |= eComponentScan.scanRemoveServices
			flags |= eComponentScan.scanDontRemoveFeeds

		if tmp != "no" and not removeAll:
			flags |= eComponentScan.scanDontRemoveUnscanned

		if self.scan_onlyfree.getValue():
			flags |= eComponentScan.scanOnlyFree

		for x in self["config"].list:
			x[1].save()

		if startScan:
			self.startScan(tlist, flags, index_to_scan, self.networkid)
		else:
			self.flags = flags
			self.feid = index_to_scan
			self.tlist = []
			self.startCableTransponderSearch(self.feid)

	def setCableTransponderSearchResult(self, tlist):
		self.tlist = tlist

	def cableTransponderSearchFinished(self):
		if self.tlist is None:
			self.tlist = []
		else:
			self.startScan(self.tlist, self.flags, self.feid)

	def startScan(self, tlist, flags, feid, networkid = 0):
		if len(tlist):
			# flags |= eComponentScan.scanSearchBAT
			if self.finished_cb:
				self.session.openWithCallback(self.finished_cb, ServiceScan, [{"transponders": tlist, "feid": feid, "flags": flags, "networkid": networkid}])
			else:
				self.session.open(ServiceScan, [{"transponders": tlist, "feid": feid, "flags": flags, "networkid": networkid}])
		else:
			if self.finished_cb:
				self.session.openWithCallback(self.finished_cb, MessageBox, _("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR)
			else:
				self.session.open(MessageBox, _("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR)

	def keyCancel(self):
		self.session.nav.playService(self.session.postScanService)
		for x in self["config"].list:
			x[1].cancel()
		self.close()

	def doCloseRecursive(self):
		self.session.nav.playService(self.session.postScanService)
		self.closeRecursive()
示例#40
0
###################################################
# E2 GUI COMMPONENTS
###################################################

###################################################

###################################################
# Config options for HOST
###################################################
config.plugins.iptvplayer.ekstraklasa_defaultformat = ConfigSelection(
    default="450",
    choices=[("0", "bitrate: najgorszy"), ("200", "bitrate: 200p"),
             ("450", "bitrate: 450p"), ("900", "bitrate: 900"),
             ("1800", "bitrate: 1800"), ("9999", "bitrate: najlepszy")])
config.plugins.iptvplayer.ekstraklasa_usedf = ConfigYesNo(default=False)
config.plugins.iptvplayer.ekstraklasa_proxy = ConfigYesNo(default=False)


def GetConfigList():
    optionList = []
    optionList.append(
        getConfigListEntry(
            "Domyślny format video:",
            config.plugins.iptvplayer.ekstraklasa_defaultformat))
    optionList.append(
        getConfigListEntry("Używaj domyślnego format video:",
                           config.plugins.iptvplayer.ekstraklasa_usedf))
    optionList.append(
        getConfigListEntry("Ekstraklasa korzystaj z proxy?",
                           config.plugins.iptvplayer.ekstraklasa_proxy))
示例#41
0
class QuickSubtitlesConfigMenu(ConfigListScreen, Screen):

	FLAG_CENTER_DVB_SUBS = 2048

	def __init__(self, session, infobar):
		Screen.__init__(self, session)
		self.infobar = infobar or self.session.infobar
		self.wait = eTimer()
		self.wait.timeout.get().append(self.resyncSubtitles)
		self.service = self.session.nav.getCurrentlyPlayingServiceReference()
		servicepath = self.service and self.service.getPath()
		if servicepath and servicepath.startswith("/") and self.service.toString().startswith("1:"):
			info = eServiceCenter.getInstance().info(self.service)
			self.service_string = info and info.getInfoString(self.service, iServiceInformation.sServiceref)
		else:
			self.service_string = self.service.toString()
		self.center_dvb_subs = ConfigYesNo(default = (eDVBDB.getInstance().getFlag(eServiceReference(self.service_string)) & self.FLAG_CENTER_DVB_SUBS) and True)
		self.center_dvb_subs.addNotifier(self.setCenterDvbSubs)
		self["videofps"] = Label("")

		sub = self.infobar.selected_subtitle
		if sub[0] == 0:  # dvb
			menu = [
				getConfigMenuItem("config.subtitles.dvb_subtitles_yellow"),
				getConfigMenuItem("config.subtitles.dvb_subtitles_backtrans"),
				getConfigMenuItem("config.subtitles.dvb_subtitles_original_position"),
				(_("Center DVB subtitles"), self.center_dvb_subs),
				getConfigMenuItem("config.subtitles.subtitle_position"),
				getConfigMenuItem("config.subtitles.subtitle_bad_timing_delay"),
				getConfigMenuItem("config.subtitles.subtitle_noPTSrecordingdelay"),
			]
		elif sub[0] == 1: # teletext
			menu = [
				getConfigMenuItem("config.subtitles.ttx_subtitle_colors"),
				getConfigMenuItem("config.subtitles.ttx_subtitle_original_position"),
				getConfigMenuItem("config.subtitles.subtitle_fontsize"),
				getConfigMenuItem("config.subtitles.subtitle_position"),
				getConfigMenuItem("config.subtitles.subtitle_rewrap"),
				getConfigMenuItem("config.subtitles.subtitle_borderwidth"),
				getConfigMenuItem("config.subtitles.showbackground"),
				getConfigMenuItem("config.subtitles.subtitle_alignment"),
				getConfigMenuItem("config.subtitles.subtitle_bad_timing_delay"),
				getConfigMenuItem("config.subtitles.subtitle_noPTSrecordingdelay"),
			]
		else: 		# pango
			menu = [
				getConfigMenuItem("config.subtitles.pango_subtitles_delay"),
				getConfigMenuItem("config.subtitles.pango_subtitle_colors"),
				getConfigMenuItem("config.subtitles.pango_subtitle_fontswitch"),
				getConfigMenuItem("config.subtitles.colourise_dialogs"),
				getConfigMenuItem("config.subtitles.subtitle_fontsize"),
				getConfigMenuItem("config.subtitles.subtitle_position"),
				getConfigMenuItem("config.subtitles.subtitle_alignment"),
				getConfigMenuItem("config.subtitles.subtitle_rewrap"),
				getConfigMenuItem("config.subtitles.subtitle_borderwidth"),
				getConfigMenuItem("config.subtitles.showbackground"),
				getConfigMenuItem("config.subtitles.pango_subtitles_fps"),
			]
			self["videofps"].setText(_("Video: %s fps") % (self.getFps().rstrip(".000")))

		ConfigListScreen.__init__(self, menu, self.session, on_change = self.changedEntry)

		self["actions"] = NumberActionMap(["SetupActions"],
		{
			"cancel": self.cancel,
			"ok": self.ok,
		},-2)

		self.onLayoutFinish.append(self.layoutFinished)

	def setCenterDvbSubs(self, configElement):
		if configElement.value:
			eDVBDB.getInstance().addFlag(eServiceReference(self.service_string), self.FLAG_CENTER_DVB_SUBS)
			config.subtitles.dvb_subtitles_centered.value = True
		else:
			eDVBDB.getInstance().removeFlag(eServiceReference(self.service_string), self.FLAG_CENTER_DVB_SUBS)
			config.subtitles.dvb_subtitles_centered.value = False

	def layoutFinished(self):
		if not self["videofps"].text:
			self.instance.resize(eSize(self.instance.size().width(), self["config"].l.getItemSize().height()*len(self["config"].getList()) + 10))

	def changedEntry(self):
		if self["config"].getCurrent() in [getConfigMenuItem("config.subtitles.pango_subtitles_delay"),getConfigMenuItem("config.subtitles.pango_subtitles_fps")]:
			self.wait.start(500, True)

	def resyncSubtitles(self):
		self.infobar.setSeekState(self.infobar.SEEK_STATE_PAUSE)
		self.infobar.setSeekState(self.infobar.SEEK_STATE_PLAY)

	def getFps(self):
		service = self.session.nav.getCurrentService()
		info = service and service.info()
		if not info:
			return ""
		fps = info.getInfo(iServiceInformation.sFrameRate)
		if fps > 0:
			return "%6.3f" % (fps/1000.)
		return ""

	def cancel(self):
		self.center_dvb_subs.removeNotifier(self.setCenterDvbSubs)
		self.close()

	def ok(self):
		config.subtitles.save()
		self.close()
示例#42
0
enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer
boxtype = getBoxType()

if os.path.isfile("/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/plugin.pyo") and boxtype in ('dm7080','dm820'):
	import pyo_patcher

from traceback import print_exc
profile("SimpleSummary")
from Screens import InfoBar
from Screens.SimpleSummary import SimpleSummary

from sys import stdout, exc_info

profile("Bouquets")
from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, NoSave
config.misc.load_unlinked_userbouquets = ConfigYesNo(default=False)
def setLoadUnlinkedUserbouquets(configElement):
	enigma.eDVBDB.getInstance().setLoadUnlinkedUserbouquets(configElement.value)
config.misc.load_unlinked_userbouquets.addNotifier(setLoadUnlinkedUserbouquets)
enigma.eDVBDB.getInstance().reloadBouquets()

profile("ParentalControl")
import Components.ParentalControl
Components.ParentalControl.InitParentalControl()

profile("LOAD:Navigation")
from Navigation import Navigation

profile("LOAD:skin")
from skin import readSkin
示例#43
0
文件: plugin.py 项目: grantor/enigma2
class FastScanScreen(ConfigListScreen, Screen):
	skin = """
	<screen position="100,115" size="520,290" title="Fast Scan">
		<widget name="config" position="10,10" size="500,250" scrollbarMode="showOnDemand" />
		<widget name="introduction" position="10,265" size="500,25" font="Regular;20" halign="center" />
	</screen>"""

	def __init__(self, session, nimList):
		Screen.__init__(self, session)
		self.setTitle(_("Fast Scan"))

		self.providers = {}
		self.providers['Canal Digitaal'] = (1, 900, True)
		self.providers['TV Vlaanderen'] = (1, 910, True)
		self.providers['TéléSAT'] = (0, 920, True)
		self.providers['AustriaSat'] = (0, 950, False)
		self.providers['Skylink Czech Republic'] = (1, 30, False)
		self.providers['Skylink Slovak Republic'] = (1, 31, False)
		self.providers['TéléSAT Astra3'] = (1, 920, True)
		self.providers['AustriaSat Astra3'] = (1, 950, False)
		self.providers['Canal Digitaal Astra 1'] = (0, 900, True)
		self.providers['TV Vlaanderen  Astra 1'] = (0, 910, True)

		self.transponders = ((12515000, 22000000, eDVBFrontendParametersSatellite.FEC_5_6, 192,
			eDVBFrontendParametersSatellite.Polarisation_Horizontal, eDVBFrontendParametersSatellite.Inversion_Unknown,
			eDVBFrontendParametersSatellite.System_DVB_S, eDVBFrontendParametersSatellite.Modulation_QPSK,
			eDVBFrontendParametersSatellite.RollOff_alpha_0_35, eDVBFrontendParametersSatellite.Pilot_Off),
			(12070000, 27500000, eDVBFrontendParametersSatellite.FEC_3_4, 235,
			eDVBFrontendParametersSatellite.Polarisation_Horizontal, eDVBFrontendParametersSatellite.Inversion_Unknown,
			eDVBFrontendParametersSatellite.System_DVB_S, eDVBFrontendParametersSatellite.Modulation_QPSK,
			eDVBFrontendParametersSatellite.RollOff_alpha_0_35, eDVBFrontendParametersSatellite.Pilot_Off))

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
		{
			"ok": self.keyGo,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"menu": self.closeRecursive,
		}, -2)

		providerList = list(x[0] for x in sorted(self.providers.iteritems(), key = operator.itemgetter(1)))

		lastConfiguration = eval(config.misc.fastscan.last_configuration.value)
		if not lastConfiguration:
			lastConfiguration = (nimList[0][0], providerList[0], True, True, False)

		self.scan_nims = ConfigSelection(default = lastConfiguration[0], choices = nimList)
		self.scan_provider = ConfigSelection(default = lastConfiguration[1], choices = providerList)
		self.scan_hd = ConfigYesNo(default = lastConfiguration[2])
		self.scan_keepnumbering = ConfigYesNo(default = lastConfiguration[3])
		self.scan_keepsettings = ConfigYesNo(default = lastConfiguration[4])

		self.list = []
		self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
		self.list.append(self.tunerEntry)

		self.scanProvider = getConfigListEntry(_("Provider"), self.scan_provider)
		self.list.append(self.scanProvider)

		self.scanHD = getConfigListEntry(_("HD list"), self.scan_hd)
		self.list.append(self.scanHD)

		self.list.append(getConfigListEntry(_("Use fastscan channel numbering"), self.scan_keepnumbering))

		self.list.append(getConfigListEntry(_("Use fastscan channel names"), self.scan_keepsettings))

		ConfigListScreen.__init__(self, self.list)
		self["config"].list = self.list
		self["config"].l.setList(self.list)

		self.finished_cb = None

		self["introduction"] = Label(_("Select your provider, and press OK to start the scan"))

	def keyGo(self):
		config.misc.fastscan.last_configuration.value = `(self.scan_nims.value, self.scan_provider.value, self.scan_hd.value, self.scan_keepnumbering.value, self.scan_keepsettings.value)`
		config.misc.fastscan.save()
		self.startScan()

	def getTransponderParameters(self, number):
		transponderParameters = eDVBFrontendParametersSatellite()
		transponderParameters.frequency = self.transponders[number][0]
		transponderParameters.symbol_rate = self.transponders[number][1]
		transponderParameters.fec = self.transponders[number][2]
		transponderParameters.orbital_position = self.transponders[number][3]
		transponderParameters.polarisation = self.transponders[number][4]
		transponderParameters.inversion = self.transponders[number][5]
		transponderParameters.system = self.transponders[number][6]
		transponderParameters.modulation = self.transponders[number][7]
		transponderParameters.rolloff = self.transponders[number][8]
		transponderParameters.pilot = self.transponders[number][9]
		return transponderParameters

	def startScan(self):
		pid = self.providers[self.scan_provider.getValue()][1]
		if self.scan_hd.getValue() and self.providers[self.scan_provider.value][2]:
			pid += 1
		if self.scan_nims.value:
			self.session.open(FastScanStatus, scanTuner = int(self.scan_nims.getValue()),
				transponderParameters = self.getTransponderParameters(self.providers[self.scan_provider.getValue()][0]),
				scanPid = pid, keepNumbers = self.scan_keepnumbering.getValue(), keepSettings = self.scan_keepsettings.getValue(),
				providerName = self.scan_provider.getText())

	def keyCancel(self):
		self.close()
示例#44
0
from Plugins.Extensions.IPTVPlayer.libs.urlparser import urlparser
from Plugins.Extensions.IPTVPlayer.libs import ph
###################################################

###################################################
# FOREIGN import
###################################################
from Components.config import config, ConfigYesNo, ConfigDirectory, getConfigListEntry
from os.path import normpath
###################################################

###################################################
# Config options for HOST
###################################################
config.plugins.iptvplayer.Sciezkaurllist = ConfigDirectory(default="/hdd/")
config.plugins.iptvplayer.grupujurllist = ConfigYesNo(default=True)
config.plugins.iptvplayer.sortuj = ConfigYesNo(default=True)


def GetConfigList():
    optionList = []
    optionList.append(
        getConfigListEntry(_('Text files ytlist and urllist are in:'),
                           config.plugins.iptvplayer.Sciezkaurllist))
    optionList.append(
        getConfigListEntry(_('Sort the list:'),
                           config.plugins.iptvplayer.sortuj))
    optionList.append(
        getConfigListEntry(_('Group links into categories: '),
                           config.plugins.iptvplayer.grupujurllist))
    return optionList
示例#45
0
class InstallWizard(Screen, ConfigListScreen):

	STATE_UPDATE = 0
	STATE_CHOISE_CHANNELLIST = 1
# 	STATE_CHOISE_SOFTCAM = 2

	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
			if is_found is False:
				self.createMenu()
		elif self.index == self.STATE_CHOISE_CHANNELLIST:
			self.enabled = ConfigYesNo(default = True)
			modes = {"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 = "19e")
			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()

	def checkNetworkCB(self, data):
		if data < 3:
			config.misc.installwizard.hasnetwork.value = True
		self.createMenu()

	def checkNetworkLinkCB(self, retval):
		if retval:
			iNetwork.checkNetworkState(self.checkNetworkCB)
		else:
			self.createMenu()

	def createMenu(self):
		try:
			test = self.index
		except:
			return
		self.list = []
		if self.index == self.STATE_UPDATE:
			if config.misc.installwizard.hasnetwork.getValue():
				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.getValue():
				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.getValue():
# 				self.list.append(getConfigListEntry(_("Softcam type"), self.softcam_type))
		self["config"].list = self.list
		self["config"].l.setList(self.list)

	def keyLeft(self):
		if self.index == 0:
			return
		ConfigListScreen.keyLeft(self)
		self.createMenu()

	def keyRight(self):
		if self.index == 0:
			return
		ConfigListScreen.keyRight(self)
		self.createMenu()

	def run(self):
		if self.index == self.STATE_UPDATE:
			if config.misc.installwizard.hasnetwork.getValue():
				self.session.open(InstallWizardIpkgUpdater, self.index, _('Please wait (updating packages)'), IpkgComponent.CMD_UPDATE)
		elif self.index == self.STATE_CHOISE_CHANNELLIST and self.enabled.getValue():
			self.session.open(InstallWizardIpkgUpdater, self.index, _('Please wait (downloading channel list)'), IpkgComponent.CMD_REMOVE, {'package': 'enigma2-plugin-settings-henksat-' + self.channellist_type.value})
# 		elif self.index == self.STATE_CHOISE_SOFTCAM and self.enabled.getValue():
# 			self.session.open(InstallWizardIpkgUpdater, self.index, _('Please wait (downloading softcam)'), IpkgComponent.CMD_INSTALL, {'package': 'enigma2-plugin-softcams-' + self.softcam_type.value})
		return
            (_("Multiboot"), "Module/Screens.FlashImage/MultibootSelection",
             "Setup"))
    if os.path.isdir("/etc/ppanels"):
        for x in [x for x in os.listdir("/etc/ppanels") if x.endswith(".xml")]:
            x = x[:-4]
            hotkey.functions.append(
                (_("PPanel") + " " + x, "PPanel/" + x, "PPanels"))
    if os.path.isdir("/usr/script"):
        for x in [x for x in os.listdir("/usr/script") if x.endswith(".sh")]:
            x = x[:-3]
            hotkey.functions.append((_("Shellscript") + " " + x,
                                     "Shellscript/" + x, "Shellscripts"))


config.misc.hotkey = ConfigSubsection()
config.misc.hotkey.additional_keys = ConfigYesNo(default=False)
for x in hotkey.hotkeys:
    exec "config.misc.hotkey.%s = ConfigText(default='%s')" % x[1:]


class HotkeySetup(Screen):
    ALLOW_SUSPEND = False

    def __init__(self, session, args=None):
        Screen.__init__(self, session)
        self.session = session
        self.setTitle(_("Hotkey Setup"))
        self["key_red"] = StaticText(_("Exit"))
        self["description"] = Label()
        self.list = []
        for x in hotkey.hotkeys:
示例#47
0
    dirname = resolveFilename(scope, name + 'mySkin/')
    file_list = []
    if fileExists(dirname):
        skin_files = listdir(dirname)
        if len(skin_files):
            for f in skin_files:
                if f.startswith('skin_') and f.endswith('.xml'):
                    file_list.append('mySkin/' + f)

    file_list = sorted(file_list, key=str.lower)
    return file_list


config.skin = ConfigSubsection()
config.skin.primary_skin = ConfigText(default=default_skin)
config.skin.primary_fallback_skin = ConfigYesNo(default=True)


def skinExists(skin=False):
    if not skin or not isinstance(skin, skin):
        skin = config.skin.primary_skin.value
    skin = resolveFilename(SCOPE_SKIN, skin)
    if not fileExists(skin):
        if fileExists(resolveFilename(SCOPE_SKIN, default_skin)):
            config.skin.primary_skin.value = default_skin
        else:
            config.skin.primary_skin.value = 'skin.xml'
        config.skin.primary_skin.save()


skinExists()
示例#48
0
pluginPrintname = "[AutomaticCleanup Ver. %s]" %VERSION
DEBUG = False # If set True, plugin won't remove any file physically, instead prints file names in log for verification purposes
###############################################################################

config.plugins.AutomaticCleanup = ConfigSubsection()
config.plugins.AutomaticCleanup.deleteCrashlogsOlderThan = ConfigSelection(default = "-1",
	choices = [("-1", _("void"))])
config.plugins.AutomaticCleanup.keepCrashlogs = ConfigSelection(default = "-1",
	choices = [("-1", _("all"))])
config.plugins.AutomaticCleanup.deleteSettingsOlderThan = ConfigSelection(default = "-1",
	choices = [("-1", _("cleanup disabled")), ("183", _("older than 6 months")), ("91", _("older than 3 months")), ("28", _("older than 4 weeks")), ("14", _("older than 2 weeks")), ("7", _("older than 1 week"))])
config.plugins.AutomaticCleanup.keepSettings = ConfigSelection(default = "-1",
	choices = [("-1", _("all")), ("10", _("last 10")), ("5", _("last 5")), ("3", _("last 3")), ("2", _("last 2")), ("1", _("only last one"))])
config.plugins.AutomaticCleanup.deleteTimersOlderThan = ConfigSelection(default = "-1",
	choices = [("-1", _("cleanup disabled")), ("42", _("older than 6 weeks")), ("28", _("older than 4 weeks")), ("14", _("older than 2 weeks")), ("7", _("older than 1 week")), ("3", _("older than 3 days")), ("1", _("older than 1 day")), ("0", _("immediately after recording"))])
config.plugins.AutomaticCleanup.deleteOrphanedMovieFiles = ConfigYesNo(default = False)


class AutomaticCleanupSetup(Screen, ConfigListScreen): # config

	skin = """
		<screen name="SystemCleanup" position="center,center" size="630,315" title="Automatic System Cleanup Setup" >
			<ePixmap pixmap="buttons/red.png" position="5,5" zPosition="0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="buttons/green.png" position="165,5" zPosition="0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="buttons/yellow.png" position="325,5" zPosition="0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="buttons/blue.png" position="485,5" zPosition="0" size="140,40" transparent="1" alphatest="on" />
			
			<widget render="Label" source="key_red" position="5,5" size="140,40" zPosition="2" valign="center" halign="center" backgroundColor="red" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
			<widget render="Label" source="key_green" position="165,5" size="140,40" zPosition="2" valign="center" halign="center" backgroundColor="red" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
			<widget render="Label" source="key_yellow" position="325,5" size="140,40" zPosition="2" valign="center" halign="center" backgroundColor="red" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />