config.py 374 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/env python
# coding=utf-8

"""Reads and treats configuration files"""


import os
import configparser


def read_config():
    """Reads and resolves configuration files, returns a dictionary with read
    values"""

    data = configparser.ConfigParser()
    cfg = os.path.expanduser("~/.bdtrc")
    if os.path.exists(cfg):
        data.read(cfg)
    return data