30 """ |
30 """ |
31 |
31 |
32 # load related preferences |
32 # load related preferences |
33 formatter = request.prefs['formatter'] |
33 formatter = request.prefs['formatter'] |
34 |
34 |
|
35 kwargs = dict( |
|
36 full_timestamps = full_timestamps |
|
37 ) |
|
38 |
35 # we can render in various modes... |
39 # we can render in various modes... |
36 if type in ('html', None) : |
40 if type in ('html', None) : |
37 xxx |
41 xxx |
38 |
42 |
39 elif type == 'txt' : |
43 elif type == 'txt' : |
40 # plaintext |
44 # plaintext |
41 lines = formatter.format_txt(lines, full_timestamps) |
45 lines = formatter.format_txt(lines, **kwargs) |
42 |
46 |
43 # build data |
47 # build data |
44 data = '\n'.join(data for line, data in lines) |
48 data = '\n'.join(data for line, data in lines) |
45 |
49 |
46 return http.Response(data, 'text/plain') |
50 return http.Response(data, 'text/plain') |
47 |
51 |
48 elif type == 'png' : |
52 elif type == 'png' : |
49 # PNG image |
53 # PNG image |
50 png_data = formatter.format_png(lines, full_timestamps) |
54 png_data = formatter.format_png(lines, **kwargs) |
51 |
55 |
52 return http.Response(png_data, 'image/png', charset=None) |
56 return http.Response(png_data, 'image/png', charset=None) |
53 |
57 |
54 elif type == 'rss' : |
58 elif type == 'rss' : |
55 # RSS feed |
59 # RSS feed |
56 rss_data = formatter.format_rss(lines, full_timestamps) |
60 rss_data = formatter.format_rss(lines, **kwargs) |
57 |
61 |
58 # XXX: fix to render as unicode? |
62 # XXX: fix to render as unicode? |
59 return http.Response(rss_data, 'application/rss+xml', charset=None) |
63 return http.Response(rss_data, 'application/rss+xml', charset=None) |
60 |
64 |
61 else : |
65 else : |