From b06c381833e99e3bc412444647ec142e52ca7900 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 9 Nov 2012 13:05:38 +0100 Subject: [PATCH] fix 2 issues in gallery: - use empty string when representative is not set - make all subdirectories --- sigal/gallery.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sigal/gallery.py b/sigal/gallery.py index 3794c6e..8c80574 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -68,7 +68,8 @@ class Gallery: self.paths[relpath].update(get_metadata(path)) if relpath != '.': - alb_thumb = self.paths[relpath]['representative'] + alb_thumb = self.paths[relpath].setdefault('representative', + '') if (not alb_thumb) or \ (not os.path.isfile(os.path.join(path, alb_thumb))): alb_thumb = self.find_representative(relpath) @@ -189,4 +190,4 @@ def check_or_create_dir(path): "Create the directory if it does not exist" if not os.path.isdir(path): - os.mkdir(path) + os.makedirs(path)