def GET(self): path = os.path.join(conf.static_path, "favicon.ico") if not os.path.exists(path): raise web.NotFound() web.header("Content-Type", "image/vnd.microsoft.icon") return file(path).read()
def wp_source(req_path): full_path = req_path_to_full_path(req_path) if os.path.isdir(full_path): web.header("Content-Type", "text/plain; charset=UTF-8") return "folder doesn't providers source code in Markdown" elif os.path.isfile(full_path): web.header("Content-Type", "text/plain; charset=UTF-8") return commons.cat(full_path) else: raise web.BadRequest()
def GET(self): path = os.path.join(conf.pages_path, "robots.txt") content = commons.cat(path) web.header("Content-Type", "text/plain") return content