Mercurial > hg > uploader
comparison uploader/handlers.py @ 21:183224756ded
reverse order the log for display
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 01 Aug 2011 23:53:33 -0700 |
parents | f1142bcce77a |
children | a60cf57d6628 |
comparison
equal
deleted
inserted
replaced
20:f1142bcce77a | 21:183224756ded |
---|---|
46 form += '<div><i>Currently uploaded:<ul><li>' + '</li><li>'.join(contents) + '</li></ul></i></div>' | 46 form += '<div><i>Currently uploaded:<ul><li>' + '</li><li>'.join(contents) + '</li></ul></i></div>' |
47 else: | 47 else: |
48 form += '<div><i>No files in upload directory</i></div>' | 48 form += '<div><i>No files in upload directory</i></div>' |
49 log_file = self.app.log_file | 49 log_file = self.app.log_file |
50 if log_file and os.path.exists(log_file): | 50 if log_file and os.path.exists(log_file): |
51 log_contents = file(log_file).read() | 51 log_contents = ''.join(reversed(file(log_file).readlines())) |
52 form += '<div>Upload log:<pre>%s</pre></div>' % log_contents | 52 form += '<div>Upload log:<pre>%s</pre></div>' % log_contents |
53 form += '</body></html>' | 53 form += '</body></html>' |
54 return Response(content_type='text/html', body=form) | 54 return Response(content_type='text/html', body=form) |
55 | 55 |
56 class Post(Handler): | 56 class Post(Handler): |