# HG changeset patch # User Ludovic Chabant # Date 1465110044 25200 # Node ID 0b4eb0e3736369600cfe202db67fb23c8829926b # Parent d8d2b504306ad472af1763ad46c1427b44b31785 themes: Expand `~` paths, fix error message. diff -r d8d2b504306a -r 0b4eb0e37363 piecrust/themes/base.py --- a/piecrust/themes/base.py Sat Jun 04 09:20:30 2016 -0700 +++ b/piecrust/themes/base.py Sun Jun 05 00:00:44 2016 -0700 @@ -35,9 +35,11 @@ dirs = [] themes_dirs = site_config.get('themes_dirs', []) if isinstance(themes_dirs, str): - dirs.append(os.path.join(self.root_dir, themes_dirs)) + dirs.append(os.path.join(self.root_dir, + os.path.expanduser(themes_dirs))) else: - dirs += [os.path.join(self.root_dir, p) for p in themes_dirs] + dirs += [os.path.join(self.root_dir, os.path.expanduser(p)) + for p in themes_dirs] # Add the default `themes` directory. default_themes_dir = os.path.join(self.root_dir, THEMES_DIR) @@ -51,6 +53,6 @@ return theme_dir raise ThemeNotFoundError( - "Can't find theme '%s'. Looked in: %s", + "Can't find theme '%s'. Looked in: %s" % (theme, ', '.join(dirs)))