'Given a list of template names, return the first that can be loaded.'

def select_template(self, template_name_list):

    if (not template_name_list):
        raise TemplateDoesNotExist('No    template    names    provided')
    not_found = []
    for template_name in template_name_list:
        try:
            return self.get_template(template_name)
        except TemplateDoesNotExist as exc:
            if (exc.args[0] not in not_found):
                not_found.append(exc.args[0])
            continue
    raise TemplateDoesNotExist(',    '.join(not_found))
