From efa6f82cf1da3eb0e531abbd3e57f62b96ccf1fc Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 8 Mar 2013 22:25:36 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20du=20bug:=20un=20carnet=20sans=20c?= =?UTF-8?q?hansons=20est=20autoris=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- songbook-makeindex.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/songbook-makeindex.py b/songbook-makeindex.py index 8509aa61..0ed27d56 100755 --- a/songbook-makeindex.py +++ b/songbook-makeindex.py @@ -85,10 +85,11 @@ def processSXD(filename): type = data[0] i = 1 idx = index() - while data[i].startswith('%'): - keywords = keywordPattern.match(data[i]).groups() - idx.keyword(keywords[0],keywords[1]) - i += 1 + if len(data) > 1: + while data[i].startswith('%'): + keywords = keywordPattern.match(data[i]).groups() + idx.keyword(keywords[0],keywords[1]) + i += 1 idx.compileKeywords() for i in range(i,len(data),3): entry = processSXDEntry(data[i:i+3])