1234567891011121314151617181920212223242526 |
- import os
- import yaml
- configs = (
- 'application',
- 'logging',
- 'namespaces',
- 'flask',
- )
- config = {}
- if 'FCREPO_CONFIG_DIR' in os.environ:
- CONFIG_DIR = os.environ['FCREPO_CONFIG_DIR']
- else:
- CONFIG_DIR = os.path.dirname(os.path.abspath(__file__)) + '/etc'
- for cname in configs:
- file = '{}/{}.yml'.format(CONFIG_DIR , cname)
- with open(file, 'r') as stream:
- config[cname] = yaml.load(stream, yaml.SafeLoader)
|