本文整理汇总了Python中shimehari.configuration.ConfigManager.addConfigs方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigManager.addConfigs方法的具体用法?Python ConfigManager.addConfigs怎么用?Python ConfigManager.addConfigs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shimehari.configuration.ConfigManager
的用法示例。
在下文中一共展示了ConfigManager.addConfigs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Config
# 需要导入模块: from shimehari.configuration import ConfigManager [as 别名]
# 或者: from shimehari.configuration.ConfigManager import addConfigs [as 别名]
ConfigManager.addConfigs([
Config('development', {
'DEBUG': False,
'TEST': False,
#アプリのディレクトリ名
'APP_DIRECTORY': 'app',
'MAIN_SCRIPT': 'main',
#アプリケーションinstanceの名前
'APP_INSTANCE_NAME': 'app',
'CONTROLLER_DIRECTORY': 'controllers',
'VIEW_DIRECTORY': 'views',
'ASSETS_DIRECTORY':'assets',
'STATIC_DIRECTORY':[],
#for daiginjou
'MODEL_DIRECTORY': 'models',
'PREFERRED_URL_SCHEME': 'http',
'AUTO_SETUP': True,
'CONTROLLER_AUTO_NAMESPACE': True,
'TEMPLATE_ENGINE': 'jinja2',
'SECRET_KEY': '_secret_shimehari',
'SERVER_NAME': None,
'PRESERVE_CONTEXT_ON_EXCEPTION': None,
'PERMANENT_SESSION_LIFETIME': timedelta(days=31),
'SESSION_COOKIE_NAME': '_app_session',
'SESSION_COOKIE_HTTPONLY': True,
'SESSION_COOKIE_SECURE': False,
#キャッシュ
'CACHE_STORE': None,
'CACHE_DEFAULT_TIMEOUT': 300,
'CACHE_THRESHOLD': 500,
'CACHE_KEY_PREFIX': None,
'CACHE_DIR': None,
'CACHE_OPTIONS': None,
'CACHE_ARGS': [],
'LOG_FILE_OUTPUT': False,
'LOG_FILE_ROTATE': False,
'LOG_ROTATE_MAX_BITE': (5 * 1024 * 1024),
'LOG_ROTATE_COUNT': 5,
'LOG_FILE_DIRECTORY': 'log',
'LOG_DEBUG_FORMAT': '--------------------------------------------------------------------------------\n%(levelname)s in %(module)s [%(pathname)s:%(lineno)d]:\n%(message)s\n--------------------------------------------------------------------------------',
'LOG_OUTPUT_FORMAT': '%(asctime)s %(levelname)s in %(module)s [%(pathname)s:%(lineno)d]:\n%(message)s\n--------------------------------------------------------------------------------'
})
])
示例2: Config
# 需要导入模块: from shimehari.configuration import ConfigManager [as 别名]
# 或者: from shimehari.configuration.ConfigManager import addConfigs [as 别名]
ConfigManager.addConfigs(
[
Config(
"development",
{
"DEBUG": False,
"TEST": False,
# アプリのディレクトリ名
"APP_DIRECTORY": "%s",
"MAIN_SCRIPT": "main",
# アプリケーションinstanceの名前
"APP_INSTANCE_NAME": "app",
"CONTROLLER_DIRECTORY": "controllers",
"VIEW_DIRECTORY": "views",
"ASSETS_DIRECTORY": "assets",
"STATIC_DIRECTORY": [],
# for daiginjou
"MODEL_DIRECTORY": "models",
"PREFERRED_URL_SCHEME": "http",
"AUTO_SETUP": True,
"CONTROLLER_AUTO_NAMESPACE": True,
"TEMPLATE_ENGINE": "jinja2",
"SECRET_KEY": "_secret_shimehari",
"SERVER_NAME": None,
"PRESERVE_CONTEXT_ON_EXCEPTION": None,
"PERMANENT_SESSION_LIFETIME": timedelta(days=31),
"SESSION_COOKIE_NAME": "_%s_session",
"SESSION_COOKIE_HTTPONLY": True,
"SESSION_COOKIE_SECURE": False,
# キャッシュ
"CACHE_STORE": None,
"CACHE_DEFAULT_TIMEOUT": 300,
"CACHE_THRESHOLD": 500,
"CACHE_KEY_PREFIX": None,
"CACHE_DIR": None,
"CACHE_OPTIONS": None,
"CACHE_ARGS": [],
"LOG_FILE_OUTPUT": False,
"LOG_FILE_ROTATE": False,
"LOG_ROTATE_MAX_BITE": (5 * 1024 * 1024),
"LOG_ROTATE_COUNT": 5,
"LOG_FILE_DIRECTORY": "log",
"LOG_DEBUG_FORMAT": "%s",
"LOG_OUTPUT_FORMAT": "%s",
},
)
]
)
示例3: testAddConfigs
# 需要导入模块: from shimehari.configuration import ConfigManager [as 别名]
# 或者: from shimehari.configuration.ConfigManager import addConfigs [as 别名]
def testAddConfigs(self):
configA = Config()
configB = Config('production')
configC = Config('test')
self.assertNotEqual(ConfigManager.addConfigs([configA, configB, configC]), TypeError)
示例4: testGetConfigs
# 需要导入模块: from shimehari.configuration import ConfigManager [as 别名]
# 或者: from shimehari.configuration.ConfigManager import addConfigs [as 别名]
def testGetConfigs(self):
configA = Config()
configB = Config('production')
ConfigManager.addConfigs([configA, configB])
self.assertNotEqual(ConfigManager.getConfigs(), {})
示例5: Config
# 需要导入模块: from shimehari.configuration import ConfigManager [as 别名]
# 或者: from shimehari.configuration.ConfigManager import addConfigs [as 别名]
ConfigManager.addConfigs([
Config('development', {
'DEBUG': False,
'TEST': False,
'APP_ROOT': None,
#アプリのディレクトリ名
'APP_DIRECTORY': 'testApp',
'MAIN_SCRIPT': 'main',
#アプリケーションinstanceの名前
'APP_INSTANCE_NAME': 'app',
'CONTROLLER_DIRECTORY': 'controllers',
'VIEW_DIRECTORY': 'views',
#for daiginjou
'MODEL_DIRECTORY': 'models',
'PREFERRED_URL_SCHEME': 'http',
'AUTO_SETUP': True,
'TEMPLATE_ENGINE': 'jinja2',
'USE_X_SENDFILE': False,
'SECRET_KEY': '_secret_shimehari',
'SERVER_NAME': None,
'TRAP_HTTP_EXCEPTIONS': False,
'TRAP_BAD_REQUEST_ERRORS': False,
'PRESERVE_CONTEXT_ON_EXCEPTION': None,
'PERMANENT_SESSION_LIFETIME': timedelta(days=31)
})
])