Example #1
0
    def __getattr__(self, name):
        """Look up an option value.

        :param name: the opt name (or 'dest', more precisely)
        :returns: the option value (after string subsititution) or a GroupAttr
        :raises: NoSuchOptError,ConfigFileValueError,TemplateSubstitutionError
        """
        if name in self._groups:
            return self._groups[name]
        if name not in self._opts:
            raise cfg.NoSuchOptError(name)
        return getattr(self._conf, name)
Example #2
0
 def __getattr__(self, name):
     """Look up an option value."""
     if not self._all_opts and name not in self._opts:
         raise cfg.NoSuchOptError(name)
     return getattr(self._conf[self._group], name)