本文整理匯總了Python中stoqlib.lib.configparser.StoqConfig.create方法的典型用法代碼示例。如果您正苦於以下問題:Python StoqConfig.create方法的具體用法?Python StoqConfig.create怎麽用?Python StoqConfig.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類stoqlib.lib.configparser.StoqConfig
的用法示例。
在下文中一共展示了StoqConfig.create方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _read_config
# 需要導入模塊: from stoqlib.lib.configparser import StoqConfig [as 別名]
# 或者: from stoqlib.lib.configparser.StoqConfig import create [as 別名]
def _read_config(self, options, create=False, register_station=True, check_schema=True, load_plugins=True):
from stoqlib.lib.configparser import StoqConfig
from stoq.lib.startup import setup
config = StoqConfig()
if options.load_config and options.filename:
config.load(options.filename)
else:
config.load_default()
if create:
config.create()
# FIXME: This should be removed and we should just import
# the global settings after fixing StoqConfig to
# only update the global settings.
self._db_settings = config.get_settings()
setup(config, options, register_station=register_station, check_schema=check_schema, load_plugins=load_plugins)
return config