コード例 #1
0
ファイル: test_config.py プロジェクト: Gnonpi/AnyBlok
 def test_initialize_logging(self):
     Configuration.add('logging', function_=add_logging, label='Logging')
     Configuration.set('logging_level', 'DEBUG')
     Configuration.set('logging_level_qualnames', ['test'])
     Configuration.initialize_logging()
コード例 #2
0
ファイル: wsgi.py プロジェクト: petrus-v/Anyblok_Pyramid
    configuration_post_load,
)

if BlokManager.bloks:
    # AnyBlok already load, the state are not sure, better to stop here
    sys.exit(1)


load_init_function_from_entry_points()
# load default files
ad = AppDirs('AnyBlok')
# load the global configuration file
Configuration.parse_configfile(path.join(ad.site_config_dir, 'conf.cfg'), ())
# load the user configuration file
Configuration.parse_configfile(path.join(ad.user_config_dir, 'conf.cfg'), ())
# load config file in environment variable
configfile = environ.get('ANYBLOK_CONFIGFILE')
if configfile:
    Configuration.parse_configfile(configfile)

if 'logging_level' in Configuration.configuration:
    Configuration.initialize_logging()

configuration_post_load()
BlokManager.load()
preload_databases()
config = Configurator()
config.include_from_entry_point()
config.load_config_bloks()
app = config.make_wsgi_app()
コード例 #3
0
ファイル: wsgi.py プロジェクト: jssuzanne/Anyblok_Pyramid
from os import environ, path
from appdirs import AppDirs
from anyblok import load_init_function_from_entry_points

if BlokManager.bloks:
    # AnyBlok already load, the state are not sure, better to stop here
    sys.exit(1)


load_init_function_from_entry_points()
# load default files
ad = AppDirs('AnyBlok')
# load the global configuration file
Configuration.parse_configfile(path.join(ad.site_config_dir, 'conf.cfg'), ())
# load the user configuration file
Configuration.parse_configfile(path.join(ad.user_config_dir, 'conf.cfg'), ())
# load config file in environment variable
configfile = environ.get('ANYBLOK_CONFIGFILE')
if configfile:
    Configuration.parse_configfile(configfile, ())

if 'logging_level' in Configuration.configuration:
    Configuration.initialize_logging()

BlokManager.load()
preload_databases()
config = Configurator()
config.include_from_entry_point()
config.load_config_bloks()
app = config.make_wsgi_app()
コード例 #4
0
ファイル: test_config.py プロジェクト: AnyBlok/AnyBlok
 def test_initialize_logging(self):
     Configuration.add('logging', function_=add_logging, label='Logging')
     Configuration.set('logging_level', 'DEBUG')
     Configuration.set('logging_level_qualnames', ['test'])
     Configuration.initialize_logging()