Esempio n. 1
0
    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)
Esempio n. 2
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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)
Esempio n. 5
0
    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)
Esempio n. 6
0
    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))
Esempio n. 7
0
    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))
Esempio n. 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)