urls.py
author Tero Marttila <terom@fixme.fi>
Mon, 09 Feb 2009 00:24:13 +0200
changeset 50 f13cf27a360b
parent 49 aaa62c8e5bd5
child 51 07ca28f3a9f2
permissions -rw-r--r--
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff

"""
    URL mapping for the irclogs.qmsk.net site
"""

# urltree stuff
from qmsk.web import urltree

# our own handlers
import handlers

# for types
import channels, log_formatter, utils

# our URLConfig
urls = url = urltree.URLConfig(
    type_dict   = { 
        # lookup LogChannel
        'cid':  channels.channel_list.lookup,
        'fmt':  log_formatter.by_name,
        'date': utils.Date(None, '%Y-%m-%d'),
    }
)

# urls
index           = url('/',                                                              handlers.index                  )
channel_select  = url('/channel_select/?channel:cid',                                   handlers.channel_select         )
channel_view    = url('/channels/{channel:cid}/?count:int=10&formatter:fmt=irssi',      handlers.channel_view           )
channel_last    = url('/channels/{channel:cid}/last/{count:int=100}/{format=html}',     handlers.channel_last           )
channel_date    = url('/channels/{channel:cid}/date/{date:date}/?formatter:fmt=irssi',  handlers.channel_date           )
channel_search  = url('/channels/{channel:cid}/search/?q',                              handlers.channel_search         )

# mapper
mapper = urltree.URLTree(urls)