diff 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
line wrap: on
line diff
--- a/piecrust/pathutil.py	Tue Jun 11 15:12:47 2019 -0700
+++ b/piecrust/pathutil.py	Tue Jun 11 15:14:20 2019 -0700
@@ -62,3 +62,9 @@
         os.makedirs(path, mode=mode, exist_ok=True)
     except OSError:
         pass
+
+
+def expandall(path):
+    path = os.path.expandvars(path)
+    path = os.path.expanduser(path)
+    return path