From patchwork Thu Mar 17 16:19:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [04/12] oe.utils: add inherits (sync from OE) Date: Thu, 17 Mar 2011 16:19:02 -0000 From: Christopher Larson X-Patchwork-Id: 1549 Message-Id: <3d822bd429248dc917d2899f7365114d8dc3dee3.1300378596.git.chris_larson@mentor.com> To: openembedded-core@lists.openembedded.org Cc: Chris Larson From: Chris Larson Signed-off-by: Chris Larson --- meta/lib/oe/utils.py | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 69f9384..f6d4142 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -80,3 +80,7 @@ def param_bool(cfg, field, dflt = None): elif strvalue in ('no', 'n', 'false', 'f', '0'): return False raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value)) + +def inherits(d, *classes): + """Return True if the metadata inherits any of the specified classes""" + return any(bb.data.inherits_class(cls, d) for cls in classes)