Added ~ handling to getDirectoryName.

This commit is contained in:
Jeremy Fincher 2003-09-30 10:17:46 +00:00
parent df1a26900d
commit 4ccd2291df

View File

@ -107,6 +107,9 @@ def getDirectoryName(default):
'[defaults to %s]' % os.path.join(os.curdir, default)) '[defaults to %s]' % os.path.join(os.curdir, default))
if not dir: if not dir:
dir = default dir = default
if '~' in dir:
if 'HOME' in os.environ:
dir = dir.replace('~', os.getenv('HOME'))
dir = os.path.abspath(dir) dir = os.path.abspath(dir)
try: try:
os.makedirs(dir) os.makedirs(dir)