Render first page
This commit is contained in:
parent
8783c9c05b
commit
ce3234f064
17
render
17
render
|
@ -50,9 +50,22 @@ def chunk(iterable, chunksize, fillvalue=None):
|
|||
def render_index(email_list, title, identifier):
|
||||
email_list = chunk(email_list, 4)
|
||||
|
||||
current_page = 0
|
||||
|
||||
for list_chunk in email_list:
|
||||
for message in list_chunk:
|
||||
print message[0]
|
||||
variables = {
|
||||
'page': title,
|
||||
'pagenum': "Page %d of %d" % (current_page + 1, len(email_list)),
|
||||
'title': options['title'],
|
||||
'index': "../index.html",
|
||||
'items': "".join('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>' % (message[0], message[3], message[4], message[5], message[6], message[7]) for message in list_chunk)
|
||||
}
|
||||
|
||||
print template_index % variables
|
||||
exit(1)
|
||||
|
||||
current_page += 1
|
||||
|
||||
|
||||
if os.path.isfile(options['database']) == False:
|
||||
print "Database file not found. Use the -d switch to specify a custom database path."
|
||||
|
|
Loading…
Reference in a new issue