changeset 27:4101fdb16ab2

move data up a bit
author k0s <k0scist@gmail.com>
date Sat, 31 Oct 2009 01:36:25 -0400
parents e37d117a9deb
children e54a6405a496
files bitsyblog/bitsyblog.py
diffstat 1 files changed, 7 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyblog/bitsyblog.py	Sat Oct 31 01:15:26 2009 -0400
+++ b/bitsyblog/bitsyblog.py	Sat Oct 31 01:36:25 2009 -0400
@@ -98,6 +98,13 @@
 
     def __call__(self, environ, start_response):
         request = Request(environ)
+
+        # GENSHI: data dictionary
+        request.environ['data'] = { 'site_name': self.site_name,
+                                    'request': request,
+                                    'link': self.link,
+                                    'logo': self.logo(request) }
+
         res = self.response_functions.get(request.method, self.error())(request)
         return res(environ, start_response)
 
@@ -235,12 +242,6 @@
         display the blog or respond to a get request
         """
 
-        # GENSHI: data dictionary
-        request.environ['data'] = { 'site_name': self.site_name,
-                                    'request': request,
-                                    'link': self.link,
-                                    'logo': self.logo(request) }
-
         # front matter of the site
         index = self.get_index(request)
         if index is not None:
@@ -255,12 +256,6 @@
         """
         write a blog entry and other POST requests
         """
-
-        # GENSHI: data dictionary
-        request.environ['data'] = { 'site_name': self.site_name,
-                                    'request': request,
-                                    'link': self.link,
-                                    'logo': self.logo(request) }
         
         # find user + path
         user, path = self.userpath(request)
@@ -834,12 +829,6 @@
 
     def get(self, request):
 
-        # GENSHI: global data dictionary
-        request.environ['data'] = { 'site_name': self.site_name,
-                                    'request': request,
-                                    'link': self.link,
-                                    'logo': self.logo(request) }
-
         ### user space
         user, path = self.userpath(request)
         if user not in self.users: