예제 #1
0
파일: main.py 프로젝트: bekacho/zbox_wiki
   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()
예제 #2
0
파일: main.py 프로젝트: bekacho/zbox_wiki
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()
예제 #3
0
파일: main.py 프로젝트: bekacho/zbox_wiki
    def GET(self):
        path = os.path.join(conf.pages_path, "robots.txt")
        content = commons.cat(path)

        web.header("Content-Type", "text/plain")
        return content