diff --git a/src/milla/util.py b/src/milla/util.py index 379ab4c..db0c4a6 100644 --- a/src/milla/util.py +++ b/src/milla/util.py @@ -68,7 +68,7 @@ def http_date(date): return format_date_time(stamp) -def read_config(filename): +def read_config(filename, defaults=None): '''Parse an ini file into a nested dictionary :param string filename: Path to the ini file to read @@ -108,10 +108,10 @@ def read_config(filename): with open(filename) as f: # ConfigParser API changed in Python 3.2 if hasattr(configparser.ConfigParser, 'read_file'): - cparser = configparser.ConfigParser() + cparser = configparser.ConfigParser(defaults) cparser.read_file(f) else: - cparser = configparser.SafeConfigParser() + cparser = configparser.SafeConfigParser(defaults) cparser.readfp(f) config = {}