buranun/config.py

19 lines
414 B
Python
Raw Normal View History

2018-04-21 20:09:14 +00:00
import configparser
def load(filename):
"""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']