##// END OF EJS Templates
pyramid-utils: add helper to fetch application config....
marcink -
r2340:79804d6e default
parent child Browse files
Show More
@@ -18,17 +18,23 b''
18 18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 import os
21 22 import ConfigParser
22 23 from pyramid.paster import bootstrap as pyramid_bootstrap
23 24 from pyramid.request import Request
24 25
25 26
26 def get_config(ini_path):
27 parser = ConfigParser.ConfigParser()
27 def get_config(ini_path, **kwargs):
28 parser = ConfigParser.ConfigParser(**kwargs)
28 29 parser.read(ini_path)
29 30 return parser
30 31
31 32
33 def get_app_config(ini_path):
34 from paste.deploy.loadwsgi import appconfig
35 return appconfig('config:{}'.format(ini_path), relative_to=os.getcwd())
36
37
32 38 def bootstrap(config_uri, request=None, options=None):
33 39
34 40 config = get_config(config_uri)
General Comments 0
You need to be logged in to leave comments. Login now