"""
Our URL action handlers
"""
from lib import http, template
# load templates from here
templates = template.TemplateLoader("sites/irclogs.qmsk.net/templates")
def index (request) :
"""
The topmost index page, display a list of available channels, perhaps some general stats
"""
return templates.render_to_response("index")
def channel_view (request, channel) :
"""
The main channel view page, display the most important info, and all requisite links
"""
return templates.render_to_response("channel",
channel = channel,
)
pass
def channel_last (request, channel, count, format) :
"""
Display the last x lines of channel messages in various formats
"""
if format == 'txt' :
return http.Response('\n'.join(channel.source.get_latest(count)), 'text/plain')
else :
raise http.ResponseError("Unknown filetype %r" % format)
def channel_search (request, channel) :
"""
Display the search form for the channel for GET, or do the search for POST
"""
pass