return True
return False
- def get_raw_body(self, default=None):
+ def get_raw_body(self):
try:
return open(self._filename(), 'rb').read()
except IOError, err:
if err.errno == errno.ENOENT:
- if default is None:
- default = '//[[%s?a=edit|Describe %s]]//' % (self.page_name, self.page_name)
- return default
+ return ''
if err.errno == errno.EISDIR:
return self.format_dir()
raise err
link_inline(footer, kvargs = {
'LAST_MODIFIED': strftime(config_get('datetime_fmt', '%Y-%m-%dT%I:%M:%S%p'), localtime(self._mtime()))
})
- print("</body></html>")
+ print('</body></html>')
def send_naked(self, kvargs=None):
if self.can_read():
- WikiFormatter(self.get_raw_body(), kvargs).print_html()
+ body = self.get_raw_body()
+ if not body:
+ body = "//[[%s?a=edit|Describe %s]]//" % (self.page_name, self.page_name)
+ WikiFormatter(body, kvargs).print_html()
else:
- send_guru("Read access denied by ACLs", "notice")
+ send_guru('Read access denied by ACLs', 'notice')
def send(self):
#css foo.css
return
if preview is None:
- preview = self.get_raw_body(default='')
+ preview = self.get_raw_body()
link_inline("sys/EditPage", kvargs = {
'EDIT_BODY': cgi.escape(preview),