當前位置: 首頁>>代碼示例>>Python>>正文


Python AutoPoller.AutoPoller類代碼示例

本文整理匯總了Python中AutoPoller.AutoPoller的典型用法代碼示例。如果您正苦於以下問題:Python AutoPoller類的具體用法?Python AutoPoller怎麽用?Python AutoPoller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AutoPoller類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: autostart

def autostart(reason, **kwargs):
	global autopoller

	# Startup
	if reason == 0 and config.plugins.autotimer.autopoll.value:
		# Start Poller
		from AutoPoller import AutoPoller
		autopoller = AutoPoller()
		autopoller.start()

		# Install NPB, main is too late because the Browser is already running
		from Plugins.SystemPlugins.Toolkit import NotifiablePluginBrowser
		NotifiablePluginBrowser.install()
	# Shutdown
	elif reason == 1:
		# Stop Poller
		if autopoller is not None:
			autopoller.stop()
			autopoller = None

		# We re-read the config so we won't save wrong information
		try:
			autotimer.readXml()
		except Exception:
			# XXX: we should at least dump the error
			pass
		else:
			autotimer.writeXml()
開發者ID:Linux-Box,項目名稱:enigma2-plugins,代碼行數:28,代碼來源:plugin.py

示例2: autostart

def autostart(reason, **kwargs):
	global autotimer
	global autopoller

	# Startup
	if reason == 0 and config.plugins.autotimer.autopoll.value:
		# Initialize AutoTimer
		from AutoTimer import AutoTimer
		autotimer = AutoTimer()
		# Start Poller
		from AutoPoller import AutoPoller
		autopoller = AutoPoller()
		autopoller.start()
	# Shutdown
	elif reason == 1:
		# Stop Poller
		if autopoller is not None:
			autopoller.stop()
			autopoller = None

		if autotimer is not None:
			# We re-read the config so we won't save wrong information
			try:
				autotimer.readXml()
			except Exception:
				# XXX: we should at least dump the error
				pass

			# Save xml
			autotimer.writeXml()

			# Remove AutoTimer
			autotimer = None
開發者ID:digidudeofdw,項目名稱:enigma2-plugins,代碼行數:33,代碼來源:plugin.py

示例3: editCallback

def editCallback(session):
	global autotimer
	global autopoller

	# XXX: canceling of GUI (Overview) won't affect config values which might have been changed - is this intended?

	# Don't parse EPG if editing was canceled
	if session is not None:
		# Poll EPGCache
		ret = autotimer.parseEPG()
		session.open(
			MessageBox,
			_("Found a total of %d matching Events.\n%d Timer were added and %d modified, %d conflicts encountered.") % (ret[0], ret[1], ret[2], len(ret[4])),
			type = MessageBox.TYPE_INFO,
			timeout = 10
		)

		# Save xml
		autotimer.writeXml()

	# Start autopoller again if wanted
	if config.plugins.autotimer.autopoll.value:
		if autopoller is None:
			from AutoPoller import AutoPoller
			autopoller = AutoPoller()
		autopoller.start(initial = False)
	# Remove instance if not running in background
	else:
		autopoller = None
		autotimer = None
開發者ID:Johnny-Dopp,項目名稱:enigma2-plugins,代碼行數:30,代碼來源:plugin.py

示例4: handleAutoPoller

def handleAutoPoller():
	global autopoller

	# Start autopoller again if wanted
	if config.plugins.autotimer.autopoll.value:
		if autopoller is None:
			from AutoPoller import AutoPoller
			autopoller = AutoPoller()
		autopoller.start(initial = False)
	# Remove instance if not running in background
	else:
		autopoller = None
開發者ID:dogfight76,項目名稱:enigma2-plugins,代碼行數:12,代碼來源:plugin.py

示例5: editCallback

def editCallback(session):
	global autopoller

	# XXX: canceling of GUI (Overview) won't affect config values which might have been changed - is this intended?

	# Don't parse EPG if editing was canceled
	if session is not None:
		# Save xml
		autotimer.writeXml()
		# Poll EPGCache
		autotimer.parseEPG()

	# Start autopoller again if wanted
	if config.plugins.autotimer.autopoll.value:
		if autopoller is None:
			from AutoPoller import AutoPoller
			autopoller = AutoPoller()
		autopoller.start()
	# Remove instance if not running in background
	else:
		autopoller = None
開發者ID:Linux-Box,項目名稱:enigma2-plugins,代碼行數:21,代碼來源:plugin.py


注:本文中的AutoPoller.AutoPoller類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。