summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2008-10-17 20:21:46 +0200
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2008-10-17 20:21:46 +0200
commitd79d1b8ceebe87d76c4226167b06f3d4dee90656 (patch)
tree459e4a60607332445e9719c53b2130992fec11cd
parentfac9e3a7c08d428ee2e0c5e1e044c7eabb21ea55 (diff)
downloadlogilab-common-d79d1b8ceebe87d76c4226167b06f3d4dee90656.tar.gz
configuration now handles paths like ~/mydir
-rw-r--r--configuration.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/configuration.py b/configuration.py
index 2a601bb..b0c8e2d 100644
--- a/configuration.py
+++ b/configuration.py
@@ -96,7 +96,7 @@ __all__ = ('OptionsManagerMixIn', 'OptionsProviderMixIn',
import os
import sys
import re
-from os.path import exists
+from os.path import exists, expanduser
from copy import copy
from ConfigParser import ConfigParser, NoOptionError, NoSectionError
@@ -490,6 +490,8 @@ class OptionsManagerMixIn(object):
"""
if config_file is None:
config_file = self.config_file
+ if '~' in config_file:
+ config_file = expanduser(config_file)
if config_file and exists(config_file):
self._config_parser.read([config_file])
elif not self.quiet: