# HG changeset patch # User k0s # Date 1256520642 14400 # Node ID 8931c5b7e632f521ed88153801d1aa4d68a33560 # Parent c293bcbe6e03d5f3f82d5cd19b5181974592a071 * fixing up index to display [in progress] * 404 if no logo diff -r c293bcbe6e03 -r 8931c5b7e632 bitsyblog/bitsyblog.py --- 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, '

bitsyblog

'