From 48150d26c6acf53aaeaf18b82cb7421613b8935e Mon Sep 17 00:00:00 2001 From: Alexandre Dupas Date: Fri, 29 Jan 2010 00:58:22 +0100 Subject: [PATCH] Sort index keys before producing the output. --- songbook-makeindex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/songbook-makeindex.py b/songbook-makeindex.py index 52a0be2f..e2af3e02 100755 --- a/songbook-makeindex.py +++ b/songbook-makeindex.py @@ -59,14 +59,14 @@ class index: def idxBlockToStr(self, letter, entries): str = '\\begin{idxblock}{'+letter+'}'+'\n' - for key in entries.keys(): + for key in sorted(entries.keys()): str += self.entryToStr(key, entries[key]) str += '\\end{idxblock}'+'\n' return str def entriesToStr(self): str = "" - for letter in self.data.keys(): + for letter in sorted(self.data.keys()): str += self.idxBlockToStr(letter, self.data[letter]) return str