Commit 164c65f0 authored by Julien Muchembled's avatar Julien Muchembled

fixup! In __buildout_signature__, fix missing parts that are pulled by recipes' __init__

parent a853099d
...@@ -1282,23 +1282,22 @@ class Buildout(DictMixin): ...@@ -1282,23 +1282,22 @@ class Buildout(DictMixin):
def __getitem__(self, section): def __getitem__(self, section):
__doing__ = 'Getting section %s.', section __doing__ = 'Getting section %s.', section
if self._initializing:
caller = self._initializing[-1]
if 'buildout' != section != caller.name:
caller.depends.add(section)
try: try:
return self._data[section] options = self._data[section]
except KeyError: except KeyError:
pass try:
data = self._raw[section]
except KeyError:
raise MissingSection(section)
try: options = self.Options(self, section, data)
data = self._raw[section] self._data[section] = options
except KeyError: options._initialize()
raise MissingSection(section)
options = self.Options(self, section, data) if self._initializing:
self._data[section] = options caller = self._initializing[-1]
options._initialize() if 'buildout' != section != caller.name:
caller.depends.add(section)
return options return options
def __setitem__(self, name, data): def __setitem__(self, name, data):
...@@ -1508,12 +1507,14 @@ class Options(DictMixin): ...@@ -1508,12 +1507,14 @@ class Options(DictMixin):
section, option = s section, option = s
if not section: if not section:
section = self.name section = self.name
elif section != 'buildout': options = self
assert not self.buildout._initializing, (self.name, else:
self.buildout._initializing[-1], self.buildout._initializing.append(self)
len(self.buildout._initializing)) try:
self.depends.add(section) options = self.buildout[section]
v = self.buildout[section].get(option, None, seen, last=last) finally:
del self.buildout._initializing[-1]
v = options.get(option, None, seen, last=last)
if v is None: if v is None:
if option == '_buildout_section_name_': if option == '_buildout_section_name_':
v = self.name v = self.name
......
...@@ -2118,6 +2118,9 @@ def test_part_pulled_by_recipe(): ...@@ -2118,6 +2118,9 @@ def test_part_pulled_by_recipe():
... <= a ... <= a
... a = A ... a = A
... b = B ... b = B
... c = ${c:x}
... [c]
... x = c
... ''') ... ''')
>>> os.chdir(sample_buildout) >>> os.chdir(sample_buildout)
...@@ -2142,7 +2145,7 @@ def test_part_pulled_by_recipe(): ...@@ -2142,7 +2145,7 @@ def test_part_pulled_by_recipe():
... ...
[b] [b]
__buildout_installed__ = __buildout_installed__ =
__buildout_signature__ = recipes-c79aac86a90182467ce2fdae8b56eb1c __buildout_signature__ = recipes-c79aac86a90182467ce2fdae8b56eb1c c:...
... ...
[a] [a]
__buildout_installed__ = __buildout_installed__ =
......
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