diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-01-13 08:42:01 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2011-01-13 08:57:18 -0700 |
commit | 9e6a8f0000fcceb7d3d3992a307323a4563ee8c2 (patch) | |
tree | c2834e742ea897de3e3a8873d7a469b5c86c0482 /lib | |
parent | 694a29105e28a2ac42a265091bf170fb909a0108 (diff) | |
download | openembedded-9e6a8f0000fcceb7d3d3992a307323a4563ee8c2.tar.gz |
oe.types: allow specifying the number base for integer
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oe/_types.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/oe/_types.py b/lib/oe/_types.py index b36060ff47..b9eb2d2b86 100644 --- a/lib/oe/_types.py +++ b/lib/oe/_types.py @@ -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)) |