"""
URL mapping for the irclogs.qmsk.net site
"""
# urltree stuff
from qmsk.web.urltree import URLConfig, URL, URLTree
# our own handlers
import handlers
# for types
import channels
# our URLConfig
url_config = URLConfig(
type_dict = {
# lookup LogChannel
'cid': channels.channel_list.lookup
}
)
# shortcut for building an URL with our url_config
def url (*args, **kwargs) :
return URL(url_config, *args, **kwargs)
# urls
index = url('/', handlers.index )
channel_select = url('/channel_select/?channel:cid', handlers.channel_select )
channel_view = url('/channels/{channel:cid}/?count:str=10', handlers.channel_view )
channel_last = url('/channels/{channel:cid}/last/{count:int=100}/{format=html}', handlers.channel_last )
channel_search = url('/channels/{channel:cid}/search', handlers.channel_search )
# mapper
mapper = URLTree(
[index, channel_select, channel_view, channel_last, channel_search]
)