sites/irclogs.qmsk.net/handlers.py
author Tero Marttila <terom@fixme.fi>
Sat, 07 Feb 2009 21:21:10 +0200
branchsites
changeset 181 54d0edb81cb8
parent 177 578eab5dafdc
child 41 9585441a4bfb
permissions -rw-r--r--
the handlers work now
170
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
"""
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     2
    Our URL action handlers
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
"""
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
181
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
     5
from lib import template
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
     6
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
     7
templates = template.TemplateLoader("sites/irclogs.qmsk.net/templates")
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
     8
170
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     9
def index (request) :
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    10
    """
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    11
        The topmost index page, display a list of available channels, perhaps some general stats
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    12
    """
181
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
    13
    
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
    14
    return templates.render_to_response("index")
170
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    15
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    16
def channel_view (request, channel) :
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    17
    """
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    18
        The main channel view page, display the most important info, and all requisite links
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    19
    """
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    20
181
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
    21
    return templates.render_to_response("channel",
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
    22
        channel_name        = channel,
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
    23
    )
54d0edb81cb8 the handlers work now
Tero Marttila <terom@fixme.fi>
parents: 177
diff changeset
    24
170
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    25
    pass
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    26
177
578eab5dafdc start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents: 170
diff changeset
    27
def channel_last (request, channel, lines, type) :
170
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    28
    """
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    29
        Display the last x lines of channel messages in various formats
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    30
    """
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    31
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    32
    pass
532c595efa1a start prototyping some site-based code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    33
177
578eab5dafdc start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents: 170
diff changeset
    34
def channel_search (request, channel) :
578eab5dafdc start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents: 170
diff changeset
    35
    """
578eab5dafdc start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents: 170
diff changeset
    36
        Display the search form for the channel for GET, or do the search for POST
578eab5dafdc start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents: 170
diff changeset
    37
    """
578eab5dafdc start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents: 170
diff changeset
    38
578eab5dafdc start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents: 170
diff changeset
    39
    pass
578eab5dafdc start working on some nify URL parsing
Tero Marttila <terom@fixme.fi>
parents: 170
diff changeset
    40