urls.py
changeset 46 185504387370
parent 45 e94ab812c0c8
child 49 aaa62c8e5bd5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/urls.py	Sun Feb 08 03:23:25 2009 +0200
@@ -0,0 +1,38 @@
+
+"""
+    URL mapping for the irclogs.qmsk.net site
+"""
+
+# urltree stuff
+from qmsk.web.urltree import URLConfig, URL, URLTree
+
+# our own handlers
+import handlers
+
+# for types
+import channels 
+
+# our URLConfig
+url_config = URLConfig(
+    type_dict   = { 
+        # lookup LogChannel
+        'cid': channels.channel_list.lookup 
+    }
+)
+
+# shortcut for building an URL with our url_config
+def url (*args, **kwargs) :
+    return URL(url_config, *args, **kwargs)
+
+# urls
+index           = url('/',                                                              handlers.index                  )
+channel_select  = url('/channel_select/?channel:cid',                                   handlers.channel_select         )
+channel_view    = url('/channels/{channel:cid}/?count:str=10',                          handlers.channel_view           )
+channel_last    = url('/channels/{channel:cid}/last/{count:int=100}/{format=html}',     handlers.channel_last           )
+channel_search  = url('/channels/{channel:cid}/search',                                 handlers.channel_search         )
+
+# mapper
+mapper = URLTree(
+    [index, channel_select, channel_view, channel_last, channel_search]
+)
+