comparison piecrust/pathutil.py @ 1157:40a40305c4e1

config: Support environment variables in theme directories.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 11 Jun 2019 15:14:20 -0700
parents 8af2ea1f5c34
children
comparison
equal deleted inserted replaced
1156:4ea64255eadf 1157:40a40305c4e1
60 def ensure_dir(path, mode=0o755): 60 def ensure_dir(path, mode=0o755):
61 try: 61 try:
62 os.makedirs(path, mode=mode, exist_ok=True) 62 os.makedirs(path, mode=mode, exist_ok=True)
63 except OSError: 63 except OSError:
64 pass 64 pass
65
66
67 def expandall(path):
68 path = os.path.expandvars(path)
69 path = os.path.expanduser(path)
70 return path