本文整理汇总了Python中config.Configuration.load方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.load方法的具体用法?Python Configuration.load怎么用?Python Configuration.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config.Configuration
的用法示例。
在下文中一共展示了Configuration.load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
# 需要导入模块: from config import Configuration [as 别名]
# 或者: from config.Configuration import load [as 别名]
def setup(self):
Configuration.load()
self.url = Configuration.integration_url(Configuration.CIRCULATION_MANAGER_INTEGRATION)
millenium = Configuration.integration(Configuration.MILLENIUM_INTEGRATION)
self.test_username = millenium.get(Configuration.AUTHENTICATION_TEST_USERNAME)
self.test_password = millenium.get(Configuration.AUTHENTICATION_TEST_PASSWORD)
示例2: doStuff
# 需要导入模块: from config import Configuration [as 别名]
# 或者: from config.Configuration import load [as 别名]
def doStuff():
global Config
global yourThread
with dataLock:
# Do your stuff with commonDataStruct Here
logger.info('rereading config file looking for changes - thread {}'.format(threading.current_thread().name))
Config = Configuration(Default_Config_FilePath)
logger.debug("Loading system config file from file: " + ConfigFilePath)
Config.load(ConfigFilePath)
# Set the next thread to happen
yourThread = threading.Timer(CONFIG_INTERVAL, doStuff, ())
yourThread.start()
示例3: import
# 需要导入模块: from config import Configuration [as 别名]
# 或者: from config.Configuration import load [as 别名]
from config import Configuration
from external_search import ExternalSearchIndex
from model import (
ExternalIntegration as EI,
production_session,
)
from s3 import S3Uploader
log = logging.getLogger(name="Core configuration import")
def log_import(integration_or_setting):
log.info("CREATED: %r" % integration_or_setting)
try:
Configuration.load()
_db = production_session()
# Import CDN configuration.
cdn_conf = Configuration.integration(u'CDN')
if cdn_conf and isinstance(cdn_conf, dict):
for k, v in cdn_conf.items():
cdn = EI(protocol=EI.CDN, goal=EI.CDN_GOAL)
_db.add(cdn)
cdn.url = unicode(v)
cdn.setting(Configuration.CDN_MIRRORED_DOMAIN_KEY).value = unicode(k)
log_import(cdn)
# Import Elasticsearch configuration.
elasticsearch_conf = Configuration.integration(u'Elasticsearch')
开发者ID:NYPL-Simplified,项目名称:server_core,代码行数:33,代码来源:20170713-18-move-third-party-config-to-external-integrations.py
示例4: Configuration
# 需要导入模块: from config import Configuration [as 别名]
# 或者: from config.Configuration import load [as 别名]
logger.info('{2} app starting up'.format(ScriptFilePath, time.ctime(
os.path.getmtime(ScriptFilePath)), App_Name))
logger.info('Scriptname: {0} modified {1}'.format(ScriptFilePath, time.ctime(
os.path.getmtime(ScriptFilePath)), App_Name))
logger.info('Options:{0}'.format(options)) # record the options as set
logger.info('logging level: {0} ({1})'.format(options.loglvl, logging.getLevelName(options.loglvl)))
#
# configuration
#
# config main, then modules. initialize config error to False
Config = Configuration(Default_Config_FilePath)
logger.debug("Loading system config file from file: " + ConfigFilePath)
Config.load(ConfigFilePath)
# # now exit the application if there have been any errors
# if Config.configError:
# logger.critical(
# "Configuration errors encountered. It's not safe to continue. Please check the logs and all the config files, both input and written by the system")
# sys.exit(1)
#
# test mode modifications
#
if options.TestMode:
CONFIG_INTERVAL = 10 #shorten config interval for testing
filename = 'check.jpg'
logger.info("taking picture - {}".format(filename))
camera_params = take_picture(filename)