コード例 #1
0
ファイル: app.py プロジェクト: lowks/untwisted
    def send_base(self, con, header, fd, data, version):
        response = Response()
        response.set_response('HTTP/1.1 200 OK')

        HTML = render('view.jinja', posts = DB.iterkeys())
        response.add_data(HTML)

        send_response(con, response)
コード例 #2
0
ファイル: app.py プロジェクト: lowks/untwisted
    def send_base(self, con, header, fd, data, version):
        # The http response.
        response = Response()
        response.set_response('HTTP/1.1 200 OK')

        HTML = """ <html> 
                   <body>
                   <p> It is simple :P </p>
                   </body> </html>
               """

        response.add_data(HTML)

        # This function should be called just once.
        send_response(con, response)
コード例 #3
0
ファイル: app.py プロジェクト: lowks/untwisted
    def load_index(self, con, header, fd, data, version):
        index = data['index'][0]

        response = Response()
        response.set_response('HTTP/1.1 200 OK')
        response.add_header(('Content-Type', 'image/jpeg'))

        response.add_data(DB[index])
        send_response(con, response)
コード例 #4
0
ファイル: app.py プロジェクト: lowks/untwisted
    def load_index(self, con, header, fd, data, version):
        index = data['index'][0]

        response = Response()
        response.set_response('HTTP/1.1 200 OK')
        response.add_header(('Content-Type', 'image/jpeg'))

        response.add_data(DB[index])
        send_response(con, response)
コード例 #5
0
ファイル: app.py プロジェクト: lowks/untwisted
    def send_base(self, con, header, fd, data, version):
        response = Response()
        response.set_response('HTTP/1.1 200 OK')

        HTML = render('view.jinja', posts=DB.iterkeys())
        response.add_data(HTML)

        send_response(con, response)
コード例 #6
0
ファイル: app.py プロジェクト: lowks/untwisted
    def load_index(self, con, header, fd, data, version):
        index = data['index'][0]
        name, quote = DB[index]
        HTML = render('view.jinja', name=name, quote=quote)
        response = Response()

        response.set_response('HTTP/1.1 200 OK')
        response.add_data(HTML)

        send_response(con, str(response))
コード例 #7
0
ファイル: app.py プロジェクト: lowks/untwisted
    def send_base(self, con, header, fd, data, version):
        # The http response.
        response = Response()
        response.set_response('HTTP/1.1 200 OK')

        HTML = render('show.jinja', posts=DB.iteritems())

        # Add a body.
        response.add_data(HTML)

        send_response(con, str(response))
コード例 #8
0
    def send_base(self, con, header, fd, data, version):
        # The http response.
        response = Response()
        response.set_response('HTTP/1.1 200 OK')

        HTML = """ <html> 
                   <body>
                   <p> It is simple :P </p>
                   </body> </html>
               """

        response.add_data(HTML)

        # This function should be called just once.
        send_response(con, response)