本文整理汇总了Python中mycroft.configuration.Configuration.updated方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.updated方法的具体用法?Python Configuration.updated怎么用?Python Configuration.updated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mycroft.configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.updated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from mycroft.configuration import Configuration [as 别名]
# 或者: from mycroft.configuration.Configuration import updated [as 别名]
def __init__(self, key_phrase="hey mycroft", config=None, lang="en-us"):
super(PreciseHotword, self).__init__(key_phrase, config, lang)
from precise_runner import (
PreciseRunner, PreciseEngine, ReadWriteStream
)
local_conf = LocalConf(USER_CONFIG)
if local_conf.get('precise', {}).get('dist_url') == \
'http://bootstrap.mycroft.ai/artifacts/static/daily/':
del local_conf['precise']['dist_url']
local_conf.store()
Configuration.updated(None)
self.download_complete = True
self.show_download_progress = Timer(0, lambda: None)
precise_config = Configuration.get()['precise']
precise_exe = self.install_exe(precise_config['dist_url'])
local_model = self.config.get('local_model_file')
if local_model:
self.precise_model = expanduser(local_model)
else:
self.precise_model = self.install_model(
precise_config['model_url'], key_phrase.replace(' ', '-')
).replace('.tar.gz', '.pb')
self.has_found = False
self.stream = ReadWriteStream()
def on_activation():
self.has_found = True
self.runner = PreciseRunner(
PreciseEngine(precise_exe, self.precise_model),
stream=self.stream, on_activation=on_activation
)
self.runner.start()