Commit fc8dcbb8 authored by Julien Muchembled's avatar Julien Muchembled

default: add support for inline templates

parent 0f8a8b27
......@@ -29,6 +29,7 @@ import os
import stat
import tempfile
import zc.buildout
from zc.buildout import UserError
if str is bytes:
str2bytes = lambda s: s
......@@ -72,9 +73,22 @@ class Recipe(object):
def _init(self, name, options):
self.output = options['output']
options_sub = options._sub
self.rendered = '$'.join(options_sub(s, None)
for s in self._read(options['url']).split('$$'))
rendered = options.get('inline')
try:
url = options['url']
except KeyError:
if rendered is None:
raise
if self.md5sum:
raise UserError("options 'inline' & 'md5sum' conflict")
self.md5sum = True # tell update() to do nothing
self.rendered = rendered
else:
Please register or sign in to reply
if rendered:
raise UserError("options 'inline' & 'url' conflict")
options_sub = options._sub
self.rendered = '$'.join(options_sub(s, None)
for s in self._read(url).split('$$'))
def _read(self, url, *args):
path, is_temp = zc.buildout.download.Download(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment