def extension_commands(manifest=None): '''Get descriptions of available extension commands. The return value is an ordered map from project paths to lists of WestExtCommandSpec objects, for projects which define extension commands. The map's iteration order matches the manifest.projects order. The return value is empty if configuration option ``commands.allow_extensions`` is false. :param manifest: a parsed ``west.manifest.Manifest`` object, or None to reload a new one. ''' allow_extensions = config.getboolean('commands', 'allow_extensions', fallback=True) if not allow_extensions: return {} if manifest is None: manifest = Manifest.from_file() specs = OrderedDict() for project in manifest.projects: if project.west_commands: specs[project.path] = _ext_specs(project) return specs
def config_getboolean(option, fallback): return config.getboolean('build', option, fallback=fallback)