config: Expand files before printing sources.

This commit is contained in:
Thomas Adamcik 2013-04-02 23:58:13 +02:00
parent a9445ab251
commit 5214100854
2 changed files with 2 additions and 1 deletions

View File

@ -254,6 +254,7 @@ def filter_enabled_extensions(raw_config, extensions):
def load_config(files, overrides, extensions):
parser = configparser.RawConfigParser()
files = [path.expand_path(f) for f in files]
sources = ['builtin-defaults'] + files + ['command-line']
logging.info('Loading config from: %s', ', '.join(sources))
@ -266,7 +267,6 @@ def load_config(files, overrides, extensions):
# Load config from a series of config files
for filename in files:
filename = path.expand_path(filename)
try:
filehandle = codecs.open(filename, encoding='utf-8')
parser.readfp(filehandle)

View File

@ -99,6 +99,7 @@ def split_path(path):
def expand_path(path):
# TODO: expandvars as well?
path = string.Template(path).safe_substitute(XDG_DIRS)
path = os.path.expanduser(path)
path = os.path.abspath(path)