diff piecrust/themes/base.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 8adc27285d93
children 5762a0b821ac
line wrap: on
line diff
--- a/piecrust/themes/base.py	Tue Jun 11 15:12:47 2019 -0700
+++ b/piecrust/themes/base.py	Tue Jun 11 15:14:20 2019 -0700
@@ -34,13 +34,13 @@
             return None
 
         # Get the list of directories in which themes are installed.
+        from piecrust.pathutil import expandall
         dirs = []
         themes_dirs = site_config.get('themes_dirs', [])
         if isinstance(themes_dirs, str):
-            dirs.append(os.path.join(self.root_dir,
-                                     os.path.expanduser(themes_dirs)))
+            dirs.append(os.path.join(self.root_dir, expandall(themes_dirs)))
         else:
-            dirs += [os.path.join(self.root_dir, os.path.expanduser(p))
+            dirs += [os.path.join(self.root_dir, expandall(p))
                      for p in themes_dirs]
 
         # Add the default `themes` directory.