[oe-commits] Chris Larson : oe.types: allow specifying the number base for integer
git version control
git at git.openembedded.org
Fri Apr 22 17:52:27 UTC 2011
Module: openembedded.git
Branch: shr/testing2011.1
Commit: d4ed14edf6de920efabca03b22508dca0d8091ca
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=d4ed14edf6de920efabca03b22508dca0d8091ca
Author: Chris Larson <chris_larson at mentor.com>
Date: Thu Jan 13 08:42:01 2011 -0700
oe.types: allow specifying the number base for integer
Signed-off-by: Chris Larson <chris_larson at mentor.com>
---
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 b36060f..b9eb2d2 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))
More information about the Openembedded-commits
mailing list