aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-01-13 08:42:01 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2011-04-22 16:39:22 +0200
commitd4ed14edf6de920efabca03b22508dca0d8091ca (patch)
treebeb55de2ab5ff3e75220fe3c508580873cbefba3
parentf12ce2877e1f8dc436286f5258ccd5ac850c81bc (diff)
downloadopenembedded-d4ed14edf6de920efabca03b22508dca0d8091ca.tar.gz
openembedded-d4ed14edf6de920efabca03b22508dca0d8091ca.tar.bz2
openembedded-d4ed14edf6de920efabca03b22508dca0d8091ca.zip
oe.types: allow specifying the number base for integer
Signed-off-by: Chris Larson <chris_larson@mentor.com>
-rw-r--r--lib/oe/_types.py10
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))