From 8783c9c05bb56a4f4cc3ae5a56d6e6321eb92c75 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 28 May 2012 04:18:44 +0200 Subject: [PATCH] Chunk loops --- render | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/render b/render index 67d6485..ee5782a 100755 --- a/render +++ b/render @@ -48,13 +48,11 @@ def chunk(iterable, chunksize, fillvalue=None): return result def render_index(email_list, title, identifier): - new_list = [] - - for message in email_list: - new_list.append((message[0], message[0])) - - new_list = chunk(new_list, 4) + email_list = chunk(email_list, 4) + for list_chunk in email_list: + for message in list_chunk: + print message[0] if os.path.isfile(options['database']) == False: print "Database file not found. Use the -d switch to specify a custom database path."