#!/usr/bin/python2
import tornado.web
import json


class Home(tornado.web.RequestHandler):
    def get(self):
        self.render('home.html')


class Help(tornado.web.RequestHandler):
    @tornado.web.asynchronous
    def get(self):
        self.render("help.html")


class Configuration(tornado.web.RequestHandler):
    """
    Responsible for displaying and updating Configuration 
    """
    @tornado.web.asynchronous
    def get(self):
        self.render(
            "configuration.html",
            configuration_api_url=self.reverse_url('configuration_api')
        )

    def reverse_url(self, name, *args):
        url = super(Configuration, self).reverse_url(name, *args)
        url = url.replace('?','')
        return url.split('None')[0]
