try to read only existing default config files

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2551 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2005-05-02 14:46:47 +00:00
parent d2a8764d18
commit b6e146750d

View file

@ -229,9 +229,13 @@ class Configuration (dict):
if not cfiles:
# system wide config settings
config_dir = _linkchecker_configdata.config_dir
cfiles.append(normpath(os.path.join(config_dir, "linkcheckerrc")))
path = normpath(os.path.join(config_dir, "linkcheckerrc"))
if os.path.exists(path):
cfiles.append(path)
# per user config settings
cfiles.append(normpath("~/.linkchecker/linkcheckerrc"))
path = normpath("~/.linkchecker/linkcheckerrc")
if os.path.exists(path):
cfiles.append(path)
self.read_config(cfiles)
# re-init logger
self['logger'] = self.logger_new('text')