def __init__(self, config, storage_cls): super(Application, self).__init__() self.config = config self.models = Models(config) self.jinja_env = Environment( loader=FileSystemLoader( os.path.join(os.path.dirname(__file__), os.pardir, "templates") ), autoescape=True ) self.url_map = Map([ Rule(r"/builds/", endpoint=self.list_builds), Rule( r"/builds/create/", endpoint=self.create_build, methods=["POST"] ), Rule(r"/builds/<platform>/", endpoint=self.list_builds), Rule(r"/builds/<platform>/latest/", endpoint=self.latest_build), Rule(r"/freenode.ver", endpoint=self.freenode_verification), Rule(r"/<path:page>", endpoint=self.other_page), Rule(r"/", endpoint=self.other_page), ]) self.storage = storage_cls(config) self.build_secrets = config["core"]["build_secrets"].split(",")