示例#1
0
	def __init__(self, session):
		self.session = session
		Screen.__init__(self, session)
		self.setup_title = _("XMLTV 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.xmltvimport.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 XMLTVConfig.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
0
 def __init__(self, session):
     self.session = session
     Screen.__init__(self, session)
     self.setup_title = _("XMLTV 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.xmltvimport.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 XMLTVConfig.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)
示例#3
0
 def doimport(self):
     if xmltvimport.isImportRunning():
         print >> log, "[XMLTVImport] Already running, won't start again"
         self.session.open(
             MessageBox,
             _("XMLTVImport Plugin\nImport of epg data is still in progress. Please wait."
               ),
             MessageBox.TYPE_ERROR,
             timeout=10,
             close_on_any_key=True)
         return
     cfg = config.plugins.xmltvimport.sources.getValue().split("|")
     sources = [s for s in XMLTVConfig.enumSources(CONFIG_PATH, filter=cfg)]
     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()
     xmltvimport.sources = sources
     self.session.openWithCallback(
         self.do_import_callback,
         MessageBox,
         _("XMLTVImport Plugin\nImport of epg data will start\nThis may take a few minutes\nIs this ok?"
           ),
         MessageBox.TYPE_YESNO,
         timeout=15,
         default=True)
示例#4
0
	def runImport(self):
		cfg = config.plugins.xmltvimport.sources.getValue().split("|")
		sources = [ s for s in XMLTVConfig.enumSources(CONFIG_PATH, filter = cfg) ]
		if sources:
			sources.reverse()
			xmltvimport.sources = sources
			xmltvimport.onDone = doneImport
			xmltvimport.beginImport(longDescUntil = config.plugins.xmltvimport.longDescDays.value * 24 * 3600 + time.time())
示例#5
0
 def runImport(self):
     cfg = config.plugins.xmltvimport.sources.getValue().split("|")
     sources = [s for s in XMLTVConfig.enumSources(CONFIG_PATH, filter=cfg)]
     if sources:
         sources.reverse()
         xmltvimport.sources = sources
         xmltvimport.onDone = doneImport
         xmltvimport.beginImport(
             longDescUntil=config.plugins.xmltvimport.longDescDays.value *
             24 * 3600 + time.time())
示例#6
0
	def doimport(self):
		if xmltvimport.isImportRunning():
			print>>log, "[XMLTVImport] Already running, won't start again"
			self.session.open(MessageBox, _("XMLTVImport Plugin\nImport of epg data is still in progress. Please wait."), MessageBox.TYPE_ERROR, timeout = 10, close_on_any_key = True)
			return
		cfg = config.plugins.xmltvimport.sources.getValue().split("|")
		sources = [ s for s in XMLTVConfig.enumSources(CONFIG_PATH, filter = cfg) ]
		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()
		xmltvimport.sources = sources
		self.session.openWithCallback(self.do_import_callback, MessageBox, _("XMLTVImport Plugin\nImport of epg data will start\nThis may take a few minutes\nIs this ok?"), MessageBox.TYPE_YESNO, timeout = 15, default = True)