示例#1
0
    def sendWebPage(self, webpage):
        content = webpage.getHtml('UTF-8')
        content_type = 'text/html'
        content_length = len(content)

        self.send_response(200)
        self.send_header("Content-type", content_type)
        self.send_header("Content-Length", content_length)
        self.end_headers()

        self.wfile.write(content)
示例#2
0
文件: pwiki.py 项目: fsarradin/pwiki
    def sendWebPage(self, webpage):
        content = webpage.getHtml('UTF-8')
        content_type = 'text/html'
        content_length = len(content)

        self.send_response(200)
        self.send_header("Content-type", content_type)
        self.send_header("Content-Length", content_length)
        self.end_headers()

        self.wfile.write(content)
示例#3
0
    def sendError(self, code, title, message):
        webpage = page_factory.buildErrorPage(title, message)
        content = webpage.getHtml('UTF-8')
        content_type = 'text/html'
        content_length = len(content)

        self.send_response(code)
        self.send_header("Content-type", content_type)
        self.send_header("Content-Length", content_length)
        self.end_headers()

        self.wfile.write(content)
示例#4
0
文件: pwiki.py 项目: fsarradin/pwiki
    def sendError(self, code, title, message):
        webpage = page_factory.buildErrorPage(title, message)
        content = webpage.getHtml('UTF-8')
        content_type = 'text/html'
        content_length = len(content)

        self.send_response(code)
        self.send_header("Content-type", content_type)
        self.send_header("Content-Length", content_length)
        self.end_headers()

        self.wfile.write(content)