changeset 19:8931c5b7e632

* fixing up index to display [in progress] * 404 if no logo
author k0s <k0scist@gmail.com>
date Sun, 25 Oct 2009 21:30:42 -0400
parents c293bcbe6e03
children 1554cb56aa2f
files bitsyblog/bitsyblog.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyblog/bitsyblog.py	Sun Oct 25 21:19:13 2009 -0400
+++ b/bitsyblog/bitsyblog.py	Sun Oct 25 21:30:42 2009 -0400
@@ -113,7 +113,7 @@
         n_links = self.number_of_links(request)
 
         ### the front page
-        if not path: 
+        if not path:
             return self.get_response(self.index(n_links))
 
         ### feeds
@@ -146,6 +146,8 @@
         # logo
         if path == 'bitsyblog.png':
             logo = os.path.join(self.file_dir, 'bitsyblog.png')
+            if not os.path.exists(logo):
+                raise exc.HTTPNotFound
             return self.get_response(file(logo, 'rb').read(), content_type='image/png') # should use FileApp
 
     def get_user_space(self, user, path, request):
@@ -234,7 +236,7 @@
                                     'escape': cgi.escape }
 
         # front matter of the site
-        index = get_index()
+        index = self.get_index(request)
         if index is not None:
             return index
 
@@ -563,7 +565,8 @@
         request.environ['data']['links'] = links
 
 
-    def index(self, n_links):
+    def index(self, request, n_links):
+        
         retval = StringIO()
         print >> retval, '<h1><img src="bitsyblog.png" alt="bitsyblog"/></h1>'