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):
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()