From fd81a1b42871cc8a3896cb27f39782e4da16cfe4 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 7 May 2011 00:43:45 +0200 Subject: [PATCH] sort images and sub-albums by name --- sigal/theme.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sigal/theme.py b/sigal/theme.py index 581241e..9bb193f 100644 --- a/sigal/theme.py +++ b/sigal/theme.py @@ -45,8 +45,9 @@ class Theme(): for dirpath, dirnames, filenames in os.walk(self.path): # filelist = [os.path.normcase(f) for f in os.listdir(dir)] if os.path.split(dirpath)[1] not in ignored: - # sort images by name - filenames.sort() + # sort images and sub-albums by name + filenames.sort(key=str.lower) + dirnames.sort(key=str.lower) self.data[dirpath] = {} self.data[dirpath]['img'] = [f for f in filenames \