buranun/config.py

16 lines
346 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
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']