2018-04-21 20:09:14 +00:00
|
|
|
import configparser
|
|
|
|
|
|
|
|
def load(filename):
|
2018-04-21 20:30:49 +00:00
|
|
|
"""Populate the config variables"""
|
2018-04-21 20:09:14 +00:00
|
|
|
global port, ssl, url_prefix
|
|
|
|
global site_name
|
2018-05-10 08:07:49 +00:00
|
|
|
global database_file
|
2018-04-21 20:09:14 +00:00
|
|
|
|
|
|
|
config = configparser.ConfigParser()
|
|
|
|
config.read(filename)
|
|
|
|
|
|
|
|
port = int(config['server']['port'])
|
|
|
|
ssl = bool(config['server']['ssl'])
|
|
|
|
url_prefix = config['server']['url_prefix']
|
|
|
|
|
|
|
|
site_name = config['site']['name']
|
2018-05-10 08:07:49 +00:00
|
|
|
|
|
|
|
database_file = config['files']['database']
|