本文整理汇总了Python中mycroft.configuration.ConfigurationManager.load_local方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigurationManager.load_local方法的具体用法?Python ConfigurationManager.load_local怎么用?Python ConfigurationManager.load_local使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mycroft.configuration.ConfigurationManager
的用法示例。
在下文中一共展示了ConfigurationManager.load_local方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from mycroft.configuration import ConfigurationManager [as 别名]
# 或者: from mycroft.configuration.ConfigurationManager import load_local [as 别名]
def __init__(self, args):
params = self.__build_params(args)
if params.config:
ConfigurationManager.load_local([params.config])
if exists(params.lib) and isdir(params.lib):
sys.path.append(params.lib)
sys.path.append(params.dir)
self.dir = params.dir
self.enable_intent = params.enable_intent
self.__init_client(params)
示例2: XMLTestRunner
# 需要导入模块: from mycroft.configuration import ConfigurationManager [as 别名]
# 或者: from mycroft.configuration.ConfigurationManager import load_local [as 别名]
import sys
import unittest
from os.path import dirname
from xmlrunner import XMLTestRunner
from mycroft.configuration import ConfigurationManager
__author__ = 'seanfitz, jdorleans'
if __name__ == "__main__":
fail_on_error = "--fail-on-error" in sys.argv
ConfigurationManager.load_local(['mycroft.ini'])
tests = unittest.TestLoader().discover(dirname(__file__), "*.py")
runner = XMLTestRunner("./build/report/tests")
result = runner.run(tests)
if fail_on_error and len(result.failures + result.errors) > 0:
sys.exit(1)
示例3: test_load_local_with_locations
# 需要导入模块: from mycroft.configuration import ConfigurationManager [as 别名]
# 或者: from mycroft.configuration.ConfigurationManager import load_local [as 别名]
def test_load_local_with_locations(self):
ConfigurationManager.load_defaults()
config = ConfigurationManager.load_local([self.config_path])
self.assert_config(config, 'pt-br', 'espeak')
示例4: test_load_local
# 需要导入模块: from mycroft.configuration import ConfigurationManager [as 别名]
# 或者: from mycroft.configuration.ConfigurationManager import load_local [as 别名]
def test_load_local(self):
ConfigurationManager.load_defaults()
self.assert_config(ConfigurationManager.load_local())
示例5: TestLoader
# 需要导入模块: from mycroft.configuration import ConfigurationManager [as 别名]
# 或者: from mycroft.configuration.ConfigurationManager import load_local [as 别名]
import sys
from unittest import TestLoader
from os.path import dirname
from xmlrunner import XMLTestRunner
from mycroft.configuration import ConfigurationManager
__author__ = 'seanfitz, jdorleans'
if __name__ == "__main__":
fail_on_error = "--fail-on-error" in sys.argv
ConfigurationManager.load_local(['mycroft.conf'], keep_user_config=False)
tests = TestLoader().discover(dirname(__file__), "*.py")
result = XMLTestRunner("./build/report/tests").run(tests)
if fail_on_error and len(result.failures + result.errors) > 0:
sys.exit(1)