oe.types: allow specifying the number base for integer
authorChris Larson <chris_larson@mentor.com>
Thu, 13 Jan 2011 15:42:01 +0000 (08:42 -0700)
committerChris Larson <chris_larson@mentor.com>
Thu, 13 Jan 2011 15:57:18 +0000 (08:57 -0700)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
lib/oe/_types.py

index b36060f..b9eb2d2 100644 (file)
@@ -82,6 +82,10 @@ def boolean(value):
         return False
     raise ValueError("Invalid boolean value '%s'" % value)
 
-def integer(value):
-    """OpenEmbedded 'integer' type"""
-    return int(value)
+def integer(value, numberbase=10):
+    """OpenEmbedded 'integer' type
+
+    Defaults to base 10, but this can be specified using the optional
+    'numberbase' flag."""
+
+    return int(value, int(numberbase))