Use expanduser instead of depending on ENV to be setup correctly.

This allows for a bit of cross platform compatability, as usually Windows
doesn't have $HOME set.
This commit is contained in:
2010-01-29 08:58:02 +00:00
parent 268f829b64
commit 3cf20807a2

View File

@@ -167,7 +167,7 @@ class TvOrganiser():
if os.path.exists(opts.config):
cfile = opts.config
else:
for path in [ '%s/.tvorganise.cfg' % os.environ['HOME'], '/etc/tvorganise.cfg']:
for path in [ os.path.expanduser('~/.tvorganise.cfg'), '/etc/tvorganise.cfg']:
if os.path.exists(path):
cfile = path
break