terom@29: terom@29: """ terom@29: URL mapping for the irclogs.qmsk.net site terom@29: """ terom@29: terom@39: # urltree stuff terom@50: from qmsk.web import urltree terom@36: terom@29: # our own handlers terom@29: import handlers terom@29: terom@41: # for types terom@51: import utils terom@51: terom@51: # for configuration terom@53: import channels terom@41: terom@72: # our URLTypes terom@72: types = dict( terom@72: # LogChannel terom@72: cid = utils.URLChannelName(channels.channel_list.dict()), terom@72: terom@72: # datetime terom@72: date = utils.URLDateType('%Y-%m-%d'), terom@72: terom@72: # UTC timestamp terom@72: ts = utils.URLTimestampType(), terom@72: ) terom@72: terom@41: # our URLConfig terom@72: urls = url = urltree.URLConfig(type_dict=types) terom@41: terom@36: # urls terom@70: index = url('/', handlers.index ) terom@70: preferences = url('/preferences', handlers.preferences_ ) terom@70: channel_select = url('/channel_select/?channel:cid', handlers.channel_select ) terom@70: channel = url('/channels/{channel:cid}', handlers.channel_last, count=20 ) terom@70: channel_last = url('/channels/{channel:cid}/last/{count:int=100}', handlers.channel_last ) terom@72: channel_link = url('/channels/{channel:cid}/link/{timestamp:ts}', handlers.channel_link ) terom@70: channel_calendar = url('/channels/{channel:cid}/calendar/{year:int=0}/{month:int=0}', handlers.channel_calendar ) terom@70: channel_date = url('/channels/{channel:cid}/date/{date:date}', handlers.channel_date ) terom@70: channel_search = url('/channels/{channel:cid}/search/?q=&count:int=&skip:int=', handlers.channel_search ) terom@36: terom@36: # mapper terom@50: mapper = urltree.URLTree(urls) terom@36: