def __getitem__(self, name):
        if name.startswith('_Macros'):
            return dict.__getitem__(self, name)
        repmethod = None
        parts = name.split('.', 1)
        if len(parts) > 1:
            repmethod = parts[1]
            name = parts[0]
        if name in self.__callbacks:
            self.__callbacks[name](name)
        if name in self.__overrides:
            return self.__repmethod(self.__overrides[name], repmethod)
        if not name in self:
            # update on access
            try:
                value = self.__macros[name]
            except KeyError:
                # let's make this error message more helpful
                # so our users will have a chance of debugging.
                if self.__ignoreUnknown:
                    return ''
                raise MacroKeyError(name)

            value = self.__macros[name]
            self[name] = value
            return self.__repmethod(value, repmethod)
        else:
            return self.__repmethod(dict.__getitem__(self, name) % self, repmethod)
dataset/ETHPy150Open sassoftware/conary/conary/build/macros.py/Macros.__getitem__/original