author | Tero Marttila <terom@fixme.fi> |
Mon, 09 Feb 2009 01:11:05 +0200 | |
changeset 51 | 07ca28f3a9f2 |
parent 50 | f13cf27a360b |
child 53 | 8103d18907a0 |
permissions | -rw-r--r-- |
29
b06ff4c05d42
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
|
b06ff4c05d42
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
""" |
b06ff4c05d42
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
URL mapping for the irclogs.qmsk.net site |
b06ff4c05d42
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
""" |
b06ff4c05d42
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
|
39
82df0bb66ca7
split off to urltree.py, and add support for types
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
6 |
# urltree stuff |
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:
49
diff
changeset
|
7 |
from qmsk.web import urltree |
36
02d4040d5946
start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents:
35
diff
changeset
|
8 |
|
29
b06ff4c05d42
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
# our own handlers |
b06ff4c05d42
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
import handlers |
b06ff4c05d42
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
|
41 | 12 |
# for types |
51
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
13 |
import utils |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
14 |
|
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
15 |
# for configuration |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
16 |
import channels, log_formatter |
41 | 17 |
|
18 |
# our URLConfig |
|
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:
49
diff
changeset
|
19 |
urls = url = urltree.URLConfig( |
51
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
20 |
type_dict = dict( |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
21 |
# LogChannel |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
22 |
cid = utils.URLChannelName(channels.channel_list.dict()), |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
23 |
|
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
24 |
# LogFormatter |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
25 |
fmt = utils.URLFormatterName(log_formatter.FORMATTERS), |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
26 |
|
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
27 |
# datetime |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
28 |
date = utils.URLDateType('%Y-%m-%d'), |
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
29 |
) |
41 | 30 |
) |
31 |
||
36
02d4040d5946
start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents:
35
diff
changeset
|
32 |
# urls |
41 | 33 |
index = url('/', handlers.index ) |
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
41
diff
changeset
|
34 |
channel_select = url('/channel_select/?channel:cid', handlers.channel_select ) |
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:
49
diff
changeset
|
35 |
channel_view = url('/channels/{channel:cid}/?count:int=10&formatter:fmt=irssi', handlers.channel_view ) |
41 | 36 |
channel_last = url('/channels/{channel:cid}/last/{count:int=100}/{format=html}', handlers.channel_last ) |
51
07ca28f3a9f2
use improved URLConfig/URLType
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
37 |
channel_date = url('/channels/{channel:cid}/calendar', handlers.channel_calendar ) |
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:
49
diff
changeset
|
38 |
channel_date = url('/channels/{channel:cid}/date/{date:date}/?formatter:fmt=irssi', handlers.channel_date ) |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
49
diff
changeset
|
39 |
channel_search = url('/channels/{channel:cid}/search/?q', handlers.channel_search ) |
36
02d4040d5946
start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents:
35
diff
changeset
|
40 |
|
02d4040d5946
start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents:
35
diff
changeset
|
41 |
# mapper |
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:
49
diff
changeset
|
42 |
mapper = urltree.URLTree(urls) |
36
02d4040d5946
start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents:
35
diff
changeset
|
43 |