本文整理汇总了Python中EPGConfig.loadUserSettings方法的典型用法代码示例。如果您正苦于以下问题:Python EPGConfig.loadUserSettings方法的具体用法?Python EPGConfig.loadUserSettings怎么用?Python EPGConfig.loadUserSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EPGConfig
的用法示例。
在下文中一共展示了EPGConfig.loadUserSettings方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import loadUserSettings [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 = []
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", "MenuActions"],
{
"red": self.cancel,
"green": self.save,
"yellow": self.doimport,
"save": self.save,
"cancel": self.cancel,
"ok": self["list"].toggleSelection,
"menu": self.cancel,
}, -2)
示例2: runImport
# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import loadUserSettings [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())
示例3: runImport
# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import loadUserSettings [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())
示例4: doimport
# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import loadUserSettings [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)
示例5: __init__
# 需要导入模块: import EPGConfig [as 别名]
# 或者: from EPGConfig import loadUserSettings [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"))