jinja2: rendered -> output, template -> url/inline
... | ... | @@ -165,8 +165,17 @@ class Recipe(Recipe): |
delimiter=import_delimiter) | ||
else: | ||
loader = None | ||
self.output = options['rendered'] | ||
self.template = options['template'] | ||
try: | ||
self.output = options['output'] | ||
except KeyError: # BBB | ||
|
||
self.output = options['rendered'] | ||
template = options['template'] | ||
if template.startswith('inline:'): | ||
self.template = True, template[7:].lstrip('\r\n') | ||
else: | ||
self.template = False, template | ||
else: | ||
self.template = self._template(options) | ||
extension_list = [x for x in (y.strip() | ||
for y in options.get('extensions', '').split()) if x] | ||
self.context = context = DEFAULT_CONTEXT.copy() | ||
... | ... | @@ -187,11 +196,10 @@ class Recipe(Recipe): |
loader=loader) | ||
def _render(self): | ||
template = self.template | ||
env = self.env | ||
if template.startswith('inline:'): | ||
source = template[7:].lstrip('\r\n') | ||
compiled_source = env.compile(source, filename='<inline>') | ||
inline, template = self.template | ||
if inline: | ||
compiled_source = env.compile(template, filename='<inline>') | ||
else: | ||
try: | ||
compiled_source = compiled_source_cache[template] | ||
... | ... |