diff taginthemiddle/middleware.py @ 2:1182315b18ac

add rudimentary code for handlers
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 04 May 2010 19:15:21 -0700
parents 837cfc05d4d9
children 8fb20b780341
line wrap: on
line diff
--- a/taginthemiddle/middleware.py	Tue May 04 18:46:05 2010 -0700
+++ b/taginthemiddle/middleware.py	Tue May 04 19:15:21 2010 -0700
@@ -5,7 +5,7 @@
 
 import os
 
-from handlers import Index
+from handlers import TagCloud, ViewTags, PostTags
 from model import Tags
 
 from genshi.template import TemplateLoader
@@ -21,8 +21,9 @@
                  'template_dirs': '',
                  'patterns': '*'
                  'tags_file': None,
-                 'url': 'tags'
-                 'post_url': '.tags'
+                 'tags_url': 'tags',
+                 'post_url': '.tags',
+                 'author': None, # for RSS
                  }
 
     def __init__(self, app, **kw):
@@ -33,11 +34,11 @@
             setattr(self, key, kw.get(key, self.defaults[key]))
         self.auto_reload = self.auto_reload.lower() == 'true'
         assert self.tags_file is not None
-        self.tags
+        self.tags = Tags(self.tags_file)
         self.patterns = self.patterns.strip().split()
 
         # request handlers
-        self.handlers = [ Cloud ]
+        self.handlers = [ TagCloud, ViewTags, PostTags ]
 
         # template loader
         self.template_dirs = self.template_dirs.split()