当前位置: 首页>>代码示例>>Python>>正文


Python ConfigYesNo.nim_index方法代码示例

本文整理汇总了Python中Components.config.ConfigYesNo.nim_index方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigYesNo.nim_index方法的具体用法?Python ConfigYesNo.nim_index怎么用?Python ConfigYesNo.nim_index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Components.config.ConfigYesNo的用法示例。


在下文中一共展示了ConfigYesNo.nim_index方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Components.config import ConfigYesNo [as 别名]
# 或者: from Components.config.ConfigYesNo import nim_index [as 别名]
	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"))
开发者ID:zveyisoglu,项目名称:stbgui,代码行数:62,代码来源:ScanSetup.py

示例2: startservicescan

# 需要导入模块: from Components.config import ConfigYesNo [as 别名]
# 或者: from Components.config.ConfigYesNo import nim_index [as 别名]
	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()
开发者ID:mcquaim,项目名称:oe-alliance-plugins,代码行数:46,代码来源:plugin.py


注:本文中的Components.config.ConfigYesNo.nim_index方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。