Exemple #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)
Exemple #2
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)
Exemple #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)
Exemple #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)
Exemple #5
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))
Exemple #6
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))
Exemple #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 = """ <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)
Exemple #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)