Patchwork [04/12] oe.utils: add inherits (sync from OE)

login
register
mail settings
Submitter Christopher Larson
Date March 17, 2011, 4:19 p.m.
Message ID <3d822bd429248dc917d2899f7365114d8dc3dee3.1300378596.git.chris_larson@mentor.com>
Download mbox | patch
Permalink /patch/1549/
State New, archived
Headers show

Comments

Christopher Larson - March 17, 2011, 4:19 p.m.
From: Chris Larson <chris_larson@mentor.com>

Signed-off-by: Chris Larson <chris_larson@mentor.com>
---
 meta/lib/oe/utils.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

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)