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


Python EPGConfig.enumSources方法代码示例

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


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

示例1: __init__

# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import enumSources [as 别名]
	def __init__(self, session):
		self.session = session
		Screen.__init__(self, session)
		self.setup_title = _("EPG Import Sources")
		Screen.setTitle(self, self.setup_title)
		self["key_red"] = Button(_("Cancel"))
		self["key_green"] = Button(_("Ok"))
		self["key_yellow"] = Button() # _("Import now"))
		self["key_blue"] = Button()
		self.onChangedEntry = []
		filter = config.plugins.epgimport.sources.getValue().split("|")
		sources = [
			# (description, value, index, selected)
			SelectionEntryComponent(x.description, x.description, 0, (filter is None) or (x.description in filter))
			for x in EPGConfig.enumSources(CONFIG_PATH, filter=None)
			]
		self["list"] = SelectionList(sources)
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions", "MenuActions"],
		{
			"red": self.cancel,
			"green": self.save,
			"yellow": self.doimport,
			"save": self.save,
			"cancel": self.cancel,
			"ok": self["list"].toggleSelection,
			"menu": self.cancel,
		}, -2)
开发者ID:popazerty,项目名称:enigma2,代码行数:29,代码来源:plugin.py

示例2: runImport

# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import enumSources [as 别名]
	def runImport(self):
		cfg = EPGConfig.loadUserSettings()
		sources = [ s for s in EPGConfig.enumSources(CONFIG_PATH, filter = cfg["sources"]) ]
		if sources:
			sources.reverse()
			epgimport.sources = sources
			epgimport.onDone = doneImport
			epgimport.beginImport(longDescUntil = config.plugins.epgimport.longDescDays.value * 24 * 3600 + time.time())
开发者ID:kakunbsc,项目名称:plugin-xmltvimport,代码行数:10,代码来源:plugin.py

示例3: runImport

# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import enumSources [as 别名]
	def runImport(self):
		cfg = config.plugins.epgimport.sources.getValue().split("|")
		sources = [ s for s in EPGConfig.enumSources(CONFIG_PATH, filter = cfg) ]
		if sources:
			sources.reverse()
			epgimport.sources = sources
			epgimport.onDone = doneImport
			epgimport.beginImport(longDescUntil = config.plugins.epgimport.longDescDays.value * 24 * 3600 + time.time())
开发者ID:popazerty,项目名称:enigma2,代码行数:10,代码来源:plugin.py

示例4: runImport

# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import enumSources [as 别名]
	def runImport(self):
		if self.prev_onlybouquet != config.plugins.epgimport.import_onlybouquet.value or self.prev_multibouquet != config.usage.multibouquet.value:
			self.prev_onlybouquet = config.plugins.epgimport.import_onlybouquet.value
			self.prev_multibouquet = config.usage.multibouquet.value
			EPGConfig.channelCache = {}
		cfg = EPGConfig.loadUserSettings()
		sources = [ s for s in EPGConfig.enumSources(CONFIG_PATH, filter = cfg["sources"]) ]
		if sources:
			sources.reverse()
			epgimport.sources = sources
			epgimport.onDone = doneImport
			epgimport.beginImport(longDescUntil = config.plugins.epgimport.longDescDays.value * 24 * 3600 + time.time())
开发者ID:Dima73,项目名称:enigma2-plugin-extensions-xmltvimport,代码行数:14,代码来源:plugin.py

示例5: doimport

# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import enumSources [as 别名]
	def doimport(self):
        	if epgimport.isImportRunning():
  	    		print>>log, "[EPGImport] Already running, won't start again"
                	self.session.open(MessageBox, _("EPGImport Plugin\nImport of epg data is still in progress. Please wait."), MessageBox.TYPE_ERROR, timeout = 10, close_on_any_key = True)
			return
		cfg = EPGConfig.loadUserSettings()
    		sources = [ s for s in EPGConfig.enumSources(CONFIG_PATH, filter = cfg["sources"]) ]
    		if not sources:
    			self.session.open(MessageBox, _("No active EPG sources found, nothing to do"), MessageBox.TYPE_INFO, timeout = 10, close_on_any_key = True)
	    		return
    		# make it a stack, first on top.
    		sources.reverse()
    		epgimport.sources = sources
        	self.session.openWithCallback(self.do_import_callback, MessageBox, _("EPGImport Plugin\nImport of epg data will start\nThis may take a few minutes\nIs this ok?"), MessageBox.TYPE_YESNO, timeout = 15, default = True)
开发者ID:kakunbsc,项目名称:plugin-xmltvimport,代码行数:16,代码来源:plugin.py

示例6: __init__

# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import enumSources [as 别名]
	def __init__(self, session):
		self.session = session
		Screen.__init__(self, session)
		self["key_red"] = Button(_("Cancel"))
		self["key_green"] = Button(_("Save"))
		self["key_blue"] = Button()
		cfg = EPGConfig.loadUserSettings()
		filter = cfg["sources"]
		tree = []
		cat = None
		for x in EPGConfig.enumSources(CONFIG_PATH, filter=None, categories=True):
			if hasattr(x, 'description'):
				sel = (filter is None) or (x.description in filter)
				entry = (x.description, x.description, sel)
				if cat is None:
					# If no category defined, use a default one.
					cat = ExpandableSelectionList.category("[.]")
					tree.append(cat)
				cat[0][2].append(entry)
				if sel:
					ExpandableSelectionList.expand(cat, True)
			else:
				cat = ExpandableSelectionList.category(x)
				tree.append(cat)
		self["list"] = ExpandableSelectionList.ExpandableSelectionList(tree, enableWrapAround=True)
		if tree:
			self["key_yellow"] = Button(_("Import current source"))
		else:
			self["key_yellow"] = Button()
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"red": self.cancel,
			"green": self.save,
			"yellow": self.do_import,
			"save": self.save,
			"cancel": self.cancel,
			"ok": self["list"].toggleSelection,
		}, -2)
		self.setTitle(_("EPG Import Sources"))
开发者ID:mrnamingo,项目名称:XMLTV-Import,代码行数:41,代码来源:plugin.py

示例7: __init__

# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import enumSources [as 别名]
	def __init__(self, session):
		self.session = session
		Screen.__init__(self, session)
		self["key_red"] = Button(_("Cancel"))
		self["key_green"] = Button(_("Ok"))
		self["key_yellow"] = Button() # _("Import now"))
		self["key_blue"] = Button()
		cfg = EPGConfig.loadUserSettings()
		filter = cfg["sources"]
		sources = [
			# (description, value, index, selected)
			SelectionEntryComponent(x.description, x.description, 0, (filter is None) or (x.description in filter))
			for x in EPGConfig.enumSources(CONFIG_PATH, filter=None)
			]
		self["list"] = SelectionList(sources)
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"red": self.cancel,
			"green": self.save,
			"yellow": self.doimport,
			"save": self.save,
			"cancel": self.cancel,
			"ok": self["list"].toggleSelection,
		}, -2)
开发者ID:kakunbsc,项目名称:plugin-xmltvimport,代码行数:26,代码来源:plugin.py


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