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