From 1cf441d26f601f77d566ae6ac07d2166a12ee14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Thu, 30 Jan 2020 12:35:32 -0800 Subject: [PATCH] commands: add WestCommand.has_manifest property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is useful for making decisions based on whether we have a manifest. Signed-off-by: Martí Bolívar --- src/west/commands.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/west/commands.py b/src/west/commands.py index 112ae32..11eb057 100644 --- a/src/west/commands.py +++ b/src/west/commands.py @@ -166,6 +166,12 @@ class WestCommand(ABC): # subclass leads to undefined results. # + @property + def has_manifest(self): + '''Property which is True if self.manifest is safe to access. + ''' + return self._manifest is not None + @property def manifest(self): '''Property for the manifest which was passed to run().