def _add_submodule(self, submodule, name=None):
if not hasattr(submodule, "elaborate"):
- if hasattr(submodule, "get_fragment"): # :deprecated:
- warnings.warn("Adding '{!r}', which implements .get_fragment() but not "
- ".elaborate(), as a submodule. .get_fragment() is deprecated, "
- "and .elaborate() should be provided instead.".format(submodule),
- DeprecationWarning, stacklevel=2)
- else:
- raise TypeError("Trying to add '{!r}', which does not implement .elaborate(), as "
- "a submodule".format(submodule))
+ raise TypeError("Trying to add '{!r}', which does not implement .elaborate(), as "
+ "a submodule".format(submodule))
self._submodules.append((submodule, name))
def _add_domain(self, cd):
while self._ctrl_stack:
self._pop_ctrl()
- @deprecated("`m.get_fragment(...)` is deprecated; use `m` instead")
- def get_fragment(self, platform): # :deprecated:
- return self.elaborate(platform)
-
- @deprecated("`m.lower(...)` is deprecated; use `m` instead")
- def lower(self, platform): # :deprecated:
- return self.elaborate(platform)
-
def elaborate(self, platform):
self._flush()
return obj
if hasattr(obj, "elaborate"):
frag = obj.elaborate(platform)
- elif hasattr(obj, "get_fragment"): # :deprecated:
- frag = obj.get_fragment(platform)
else:
raise AttributeError("Object '{!r}' cannot be elaborated".format(obj))
return Fragment.get(frag, platform)