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@73: import config terom@41: terom@72: # our URLTypes terom@72: types = dict( terom@72: # LogChannel terom@73: cid = utils.URLChannelName(config.LOG_CHANNELS.dict()), terom@72: terom@72: # datetime terom@73: date = utils.URLDateType(config.URL_DATE_FMT), 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@79: channel_last = url('/channels/{channel:cid}/last/{count:int=100}/{type=}', handlers.channel_last ) terom@108: channel_link = url('/channels/{channel:cid}/link/{timestamp:ts}/?type=', handlers.channel_link ) terom@70: channel_calendar = url('/channels/{channel:cid}/calendar/{year:int=0}/{month:int=0}', handlers.channel_calendar ) terom@108: channel_date = url('/channels/{channel:cid}/date/{date:date}/?page:int=1&type=', handlers.channel_date ) terom@118: channel_search = url('/channels/{channel:cid}/search/?q=&page:int=1&max:int=1&type=&t:list=', handlers.channel_search ) terom@36: terom@36: # mapper terom@50: mapper = urltree.URLTree(urls) terom@36: