Revize 688c63b7
Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)
src/config/configuration.py | ||
---|---|---|
38 | 38 |
Constructor |
39 | 39 |
It must initialize all variables to their default values |
40 | 40 |
""" |
41 |
self.config_file = None |
|
41 | 42 |
self.connection_string = DEFAULT_CONNECTION_STRING |
42 | 43 |
self.base_server_url = DEFAULT_SERVER_BASE_URL |
43 | 44 |
self.log_level = DEFAULT_LOG_LEVEL |
... | ... | |
65 | 66 |
app_configuration = Configuration() |
66 | 67 |
# if configuration file is not specified use the default configuration |
67 | 68 |
if config_file is not None and os.path.exists(config_file): |
69 |
app_configuration.config_file = config_file |
|
68 | 70 |
config = configparser.ConfigParser() |
69 | 71 |
config.read(config_file) |
70 | 72 |
|
... | ... | |
77 | 79 |
app_configuration.base_server_url = server_config.get(SERVER_BASE_URL, |
78 | 80 |
DEFAULT_SERVER_BASE_URL) |
79 | 81 |
app_configuration.log_level = server_config.get(SERVER_LOG_LEVEL, DEFAULT_LOG_LEVEL) |
82 |
|
|
80 | 83 |
binder.bind(Configuration, to=app_configuration, scope=singleton) |
81 | 84 |
|
82 | 85 |
|
Také k dispozici: Unified diff
Re #8707 - Logging of used config file improved