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