Skip to content

Commit

Permalink
Apply substitution for extends option
Browse files Browse the repository at this point in the history
  • Loading branch information
vietdt committed Jul 25, 2016
1 parent 4d4f428 commit bd4c1bf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/zc/buildout/buildout.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ def _open(base, filename, seen, dl_options, override, downloaded):
dl_options = _update_section(dl_options, result['buildout'])

if extends:
extends = extends.split()
extends = _sub_extends(extends, override.copy())
eresult = _open(base, extends.pop(0), seen, dl_options, override,
downloaded)
for fname in extends:
Expand All @@ -1635,6 +1635,17 @@ def _open(base, filename, seen, dl_options, override, downloaded):
seen.pop()
return result

def _sub_extends(extends, override):
"""Apply substitution for extends option
"""
data = _unannotate(dict([('buildout', override)]))
data['buildout']['extends'] = extends
data_ops = Options(data, 'buildout', data['buildout'])
data['buildout'] = data_ops
# utilize Options' _sub
ops = Options(data, 'buildout', data['buildout'])
return ops.get('extends').split()


ignore_directories = '.svn', 'CVS', '__pycache__'
_dir_hashes = {}
Expand Down

0 comments on commit bd4c1bf

Please sign in to comment.