def build(cls, arg_name: ArgName, templates: Templates): paths = arg_name.split(cls.path_delimiter) path = os.path.join(cls.prefix, *paths) for suffix in cls.suffixes: try: return templates.get_template(path + suffix) except jinja2.TemplateNotFound: pass raise ConfigurationError('No template found for "%s".' % arg_name)
def build(cls, headers: Headers, arg_name: ArgName): return headers.get(arg_name.replace('_', '-'))