From: Bernardo Innocenti Date: Tue, 8 Jan 2008 22:09:55 +0000 (+0100) Subject: Don't choke on directories in full text search X-Git-Tag: v3.0~37 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=b28b1e3ff04b7139e2b3a3b5729b91080faefe2b;p=geekigeeki.git Don't choke on directories in full text search --- diff --git a/geekigeeki.py b/geekigeeki.py index a1c99a0..db11433 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -593,6 +593,8 @@ class Page: except IOError, er: if er.errno == errno.ENOENT: return '' # just doesn't exist, use default + if er.errno == errno.EISDIR: + return 'DIR' raise er def get_attrs(self): @@ -690,12 +692,12 @@ class Page: send_footer(self.page_name) def send_raw(self, mimetype='text/plain'): - if not self.can_read(): + if self.can_read(): + body = self.get_raw_body() + emit_header(mimetype) + print body + else: send_title(None, msg='Read access denied by ACLs', msg_type='notice') - return - body = self.get_raw_body() - emit_header(mimetype) - print body def _write_file(self, text): tmp_filename = self._tmp_filename()