author | Tero Marttila <terom@fixme.fi> |
Sat, 07 Feb 2009 17:10:06 +0200 | |
branch | sites |
changeset 175 | fc03275ad1ec |
parent 171 | 5ad9e9459cab |
child 35 | 79ea0e2a6cc2 |
permissions | -rw-r--r-- |
170
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
|
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
""" |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
URL mapping for the irclogs.qmsk.net site |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
""" |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
|
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
# our own handlers |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
import handlers |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
|
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
# library stuff |
171
5ad9e9459cab
route requests through sites/www.qmsk.net, although still hardcoded
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
10 |
from lib.map import StaticMapping, map, mapre |
170
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
|
171
5ad9e9459cab
route requests through sites/www.qmsk.net, although still hardcoded
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
12 |
def build_mapper () : |
170
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
""" |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
14 |
Construct and return the Mapping object |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
15 |
""" |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
16 |
|
171
5ad9e9459cab
route requests through sites/www.qmsk.net, although still hardcoded
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
17 |
return StaticMapping([ |
170
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
18 |
map( '/', handlers.index ), |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
map( '/channel/%s', handlers.channel_view ), |
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
20 |
mapre( r'^/channel/(\w+)/last/(\d+)(\.\w+)?', handlers.channel_last ), |
171
5ad9e9459cab
route requests through sites/www.qmsk.net, although still hardcoded
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
21 |
]) |
170
532c595efa1a
start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
22 |