11 import log_formatter |
11 import log_formatter |
12 |
12 |
13 # build relative paths |
13 # build relative paths |
14 relpath = lambda path : os.path.join(os.path.dirname(__file__), path) |
14 relpath = lambda path : os.path.join(os.path.dirname(__file__), path) |
15 |
15 |
|
16 ### ### |
|
17 ### Configuration ### |
|
18 ### ### |
|
19 |
16 # timezone to use for logs |
20 # timezone to use for logs |
17 LOG_TIMEZONE = pytz.timezone('Europe/Helsinki') |
21 LOG_TIMEZONE = pytz.timezone('Europe/Helsinki') |
18 |
22 |
19 # timestamp format for logfiles |
23 # timestamp format for logfiles |
20 LOG_TIMESTAMP_FMT = '%H:%M:%S' |
24 LOG_TIMESTAMP_FMT = '%H:%M:%S' |
21 |
25 |
22 # character set used for logfiles |
26 # character set used for logfiles |
23 LOG_CHARSET = 'utf-8' |
27 LOG_CHARSET = 'utf-8' |
24 |
28 |
25 # log filename format |
29 # log filename format |
26 LOG_FILENAME_FMT = '%Y-%m-%d' |
30 LOG_FILENAME_FMT = '%Y-%m-%d' |
27 |
31 |
28 # the log parser that we use |
32 # the log parser that we use |
29 LOG_PARSER = IrssiParser(LOG_TIMEZONE, LOG_TIMESTAMP_FMT) |
33 LOG_PARSER = IrssiParser(LOG_TIMEZONE, LOG_TIMESTAMP_FMT) |
30 |
34 |
31 # the statically defined channel list |
35 # the statically defined channel list |
32 LOG_CHANNELS = ChannelList([ |
36 LOG_CHANNELS = ChannelList([ |
33 LogChannel('tycoon', "OFTC", "#tycoon", |
37 LogChannel('tycoon', "OFTC", "#tycoon", |
34 LogDirectory(relpath('logs/tycoon'), LOG_TIMEZONE, LOG_PARSER, LOG_CHARSET, LOG_FILENAME_FMT) |
38 LogDirectory(relpath('logs/tycoon'), LOG_TIMEZONE, LOG_PARSER, LOG_CHARSET, LOG_FILENAME_FMT) |
35 ), |
39 ), |
36 |
40 |
37 LogChannel('openttd', "OFTC", "#openttd", |
41 LogChannel('openttd', "OFTC", "#openttd", |
38 LogDirectory(relpath('logs/openttd'), LOG_TIMEZONE, LOG_PARSER, LOG_CHARSET, LOG_FILENAME_FMT) |
42 LogDirectory(relpath('logs/openttd'), LOG_TIMEZONE, LOG_PARSER, LOG_CHARSET, LOG_FILENAME_FMT) |
39 ), |
43 ), |
40 ]) |
44 ]) |
41 |
45 |
42 # date format for URLs |
46 # date format for URLs |
43 URL_DATE_FMT = '%Y-%m-%d' |
47 URL_DATE_FMT = '%Y-%m-%d' |
44 |
48 |
45 # month name format |
49 # month name format |
46 MONTH_FMT = '%B %Y' |
50 MONTH_FMT = '%B %Y' |
47 |
51 |
48 # timezone name format |
52 # timezone name format |
49 TIMEZONE_FMT = '%Z %z' |
53 TIMEZONE_FMT = '%Z %z' |
|
54 |
|
55 # TTF fonts to use for drawing images |
|
56 FORMATTER_IMAGE_FONTS = { |
|
57 'default': (None, "Ugly default font" ), |
|
58 'ttf-dejavu-mono': ("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf", "DejaVu Sans Mono" ), |
|
59 'ttf-liberation-mono': ("/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Regular.ttf", "Liberation Mono Regular" ) |
|
60 } |
50 |
61 |
51 # available formatters |
62 # available formatters |
52 LOG_FORMATTERS = log_formatter.FORMATTERS |
63 LOG_FORMATTERS = { |
|
64 'irssi': IrssiFormatter, |
|
65 } |
53 |
66 |
54 # default preferences |
67 # default preferences |
55 PREF_TIME_FMT_DEFAULT = '%H:%M:%S' |
68 PREF_TIME_FMT_DEFAULT = '%H:%M:%S' |
56 PREF_DATE_FMT_DEFAULT = '%Y-%m-%d' |
69 PREF_DATE_FMT_DEFAULT = '%Y-%m-%d' |
57 PREF_TIMEZONE_DEFAULT = pytz.utc |
70 PREF_TIMEZONE_DEFAULT = pytz.utc |
58 PREF_FORMATTER_DEFAULT = IrssiFormatter |
71 PREF_FORMATTER_DEFAULT = IrssiFormatter |
59 PREF_COUNT_DEFAULT = 200 |
72 PREF_COUNT_DEFAULT = 200 |
60 PREF_COUNT_MAX = None |
73 PREF_COUNT_MAX = None |
|
74 PREF_IMAGE_FONT_DEFAULT = 'default' |
|
75 PREF_IMAGE_FONT_SIZE_DEFAULT = 10 |
|
76 PREF_IMAGE_FONT_SIZE_MAX = 32 |
61 |
77 |
62 # search line count options |
78 # search line count options |
63 SEARCH_LINE_COUNT_OPTIONS = ( |
79 SEARCH_LINE_COUNT_OPTIONS = ( |
64 (50, 50), |
80 (50, 50), |
65 (100, 100), |
81 (100, 100), |
66 (200, 200), |
82 (200, 200), |
67 (None, "∞"), |
83 (None, "∞"), |
68 ) |
84 ) |