From 9b54dd8e185291f6656fca3f38da1c38947c8dd6 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 27 Oct 2017 17:22:12 +1100 Subject: sb: Add a defined check. Updates #3210. --- source-builder/sb/macros.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source-builder/sb/macros.py b/source-builder/sb/macros.py index 2af8d36..28a52b2 100644 --- a/source-builder/sb/macros.py +++ b/source-builder/sb/macros.py @@ -447,6 +447,9 @@ class macros: if key in self.macros[map]: del self.macros[map][key] + def defined(self, key, globals = True, maps = None): + return self.get(key, globals, maps) is not None + def expand(self, _str): """Simple basic expander of config file macros.""" expanded = True -- cgit v1.2.3