author | Tero Marttila <terom@fixme.fi> |
Tue, 10 Feb 2009 03:22:43 +0200 | |
changeset 80 | a0662cff1d9d |
parent 79 | 43ac75054d5c |
child 86 | 645cf9c4441e |
permissions | -rw-r--r-- |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
Format LogLines into some other representation |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
|
69 | 5 |
import re, xml.sax.saxutils |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
from log_line import LogTypes |
79 | 8 |
from log_formatter_pil import PILImageFormatter |
80
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
9 |
from log_formatter_rss import RSSFormatter |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
class LogFormatter (object) : |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
12 |
""" |
65 | 13 |
Provides a method to format series of LogLines into various output formats, with varying themes. |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
14 |
""" |
51
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
15 |
|
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
16 |
# machine-readable name |
51
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
17 |
name = None |
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
18 |
|
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
19 |
# human-readable name |
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
20 |
title = None |
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
21 |
|
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
22 |
## parameters |
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
23 |
# use a fixed-width font for HTML output |
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
24 |
html_fixedwidth = True |
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
25 |
|
79 | 26 |
def __init__ (self, tz, timestamp_fmt, img_ttf_path, img_font_size) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
27 |
""" |
79 | 28 |
Initialize to format timestamps with the given timezone and timestamp. |
29 |
||
30 |
Use the given TTF font to render image text with the given size, if given, otherwise, a default one. |
|
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
31 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
32 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
33 |
self.tz = tz |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
34 |
self.timestamp_fmt = timestamp_fmt |
79 | 35 |
self.img_ttf_path = img_ttf_path |
36 |
self.img_font_size = img_font_size |
|
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
37 |
|
65 | 38 |
def _format_line_text (self, line, template_dict, full_timestamp=False) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
39 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
40 |
Format the given line as text, using the given { type: string template } dict |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
41 |
""" |
65 | 42 |
|
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
43 |
# look up the template |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
44 |
template = template_dict[line.type] |
65 | 45 |
|
46 |
# convert timestamp into display timezone |
|
47 |
dtz = line.timestamp.astimezone(self.tz) |
|
48 |
||
49 |
# full timestamps? |
|
50 |
if full_timestamp : |
|
73
5a7188bf2894
split defined configuration constants into config, and implement search result pagination
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
51 |
# XXX: ugly hack |
65 | 52 |
timestamp_fmt = '%Y-%m-%d ' + self.timestamp_fmt |
53 |
||
54 |
else : |
|
55 |
timestamp_fmt = self.timestamp_fmt |
|
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
56 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
57 |
# build timestamp |
65 | 58 |
timestamp = dtz.strftime(timestamp_fmt) |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
59 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
60 |
# format with dict |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
61 |
return template % dict( |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
62 |
timestamp = timestamp, |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
63 |
source = line.source, |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
64 |
data = line.data, |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
65 |
) |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
66 |
|
65 | 67 |
def format_txt (self, lines, full_timestamps=False) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
68 |
""" |
65 | 69 |
Format given lines as plaintext. |
70 |
||
71 |
If full_timestamps is given, the output will contain full timestamps with both date and time. |
|
72 |
||
73 |
No trailing newlines. |
|
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
74 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
75 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
76 |
abstract |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
77 |
|
65 | 78 |
def format_html (self, lines, full_timestamps=False) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
79 |
""" |
65 | 80 |
Format as HTML. |
81 |
||
82 |
See format_txt for information about arguments |
|
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
83 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
84 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
85 |
abstract |
79 | 86 |
|
80
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
87 |
def format_png (self, lines, full_timestamps=False) : |
79 | 88 |
""" |
89 |
Format as a PNG image, returning the binary PNG data |
|
90 |
""" |
|
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
91 |
|
80
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
92 |
abstract |
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
93 |
|
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
94 |
def format_rss (self, lines, full_timestamps=False) : |
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
95 |
""" |
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
96 |
Format as an XML RSS document |
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
97 |
""" |
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
98 |
|
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
99 |
abstract |
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
100 |
|
69 | 101 |
class BaseHTMLFormatter (object) : |
102 |
""" |
|
103 |
Implements some HTML-formatting utils |
|
104 |
""" |
|
105 |
||
106 |
URL_REGEXP = re.compile(r"http://\S+") |
|
107 |
||
108 |
def _process_links (self, line) : |
|
109 |
""" |
|
110 |
Processed the rendered line, adding in <a href>'s for things that look like URLs, returning the new line. |
|
111 |
||
112 |
The line should already be escaped |
|
113 |
""" |
|
114 |
||
115 |
def _encode_url (match) : |
|
116 |
# encode URL |
|
117 |
url_html = match.group(0) |
|
118 |
url_link = xml.sax.saxutils.unescape(url_html) |
|
119 |
||
120 |
return '<a href="%(url_link)s">%(url_html)s</a>' % dict(url_link=url_link, url_html=url_html) |
|
121 |
||
122 |
return self.URL_REGEXP.sub(_encode_url, line) |
|
123 |
||
80
a0662cff1d9d
add RSSFormatter, and link to different types from channel_last.tmpl...
Tero Marttila <terom@fixme.fi>
parents:
79
diff
changeset
|
124 |
class IrssiTextFormatter (RSSFormatter, PILImageFormatter, LogFormatter) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
125 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
126 |
Implements format_txt for irssi-style output |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
127 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
128 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
129 |
# format definitions by type |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
130 |
__FMT = { |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
131 |
LogTypes.RAW : "%(timestamp)s %(data)s", |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
132 |
} |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
133 |
|
65 | 134 |
def format_txt (self, lines, full_timestamps=False) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
135 |
# ...handle each line |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
136 |
for line in lines : |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
137 |
# using __TYPES |
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
138 |
yield line, self._format_line_text(line, self.__FMT, full_timestamps) |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
139 |
|
69 | 140 |
class IrssiFormatter (IrssiTextFormatter, BaseHTMLFormatter) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
141 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
142 |
Implements plain black-and-white irssi-style formatting |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
143 |
""" |
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
144 |
|
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
145 |
# name |
51
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
146 |
name = 'irssi' |
59
8ec729c5d998
ugly, but working, preferences editor
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
147 |
title = "Irssi (plain)" |
51
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
148 |
|
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
149 |
# parameters |
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
150 |
html_fixedwidth = True |
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
151 |
|
79 | 152 |
def format_html (self, lines, **kwargs) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
153 |
""" |
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
154 |
Just uses format_txt, but processes links, etc |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
155 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
156 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
157 |
# format using IrssiTextFormatter |
79 | 158 |
for line, txt in self.format_txt(lines, **kwargs) : |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
159 |
# escape HTML |
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
160 |
html = xml.sax.saxutils.escape(txt) |
69 | 161 |
|
162 |
# process links |
|
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
163 |
html = self._process_links(html) |
69 | 164 |
|
165 |
# yield |
|
72
5ade0288f2ec
implement line-links as UTC timestamps
Tero Marttila <terom@fixme.fi>
parents:
69
diff
changeset
|
166 |
yield line, html |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
167 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
168 |
def by_name (name) : |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
169 |
""" |
64
cdb6403c2498
beginnings of a LogSearchIndex class
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
170 |
Lookup and return a class LogFormatter by name |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
171 |
""" |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
172 |
|
64
cdb6403c2498
beginnings of a LogSearchIndex class
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
173 |
return FORMATTERS[name] |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
174 |