diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/lib/oe/data.py | |
download | poky-c527fd1f14c27855a37f2e8ac5346ce8d940ced2.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/lib/oe/data.py')
-rw-r--r-- | meta/lib/oe/data.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/lib/oe/data.py b/meta/lib/oe/data.py new file mode 100644 index 0000000000..4cc0e02968 --- /dev/null +++ b/meta/lib/oe/data.py | |||
@@ -0,0 +1,17 @@ | |||
1 | import oe.maketype | ||
2 | |||
3 | def typed_value(key, d): | ||
4 | """Construct a value for the specified metadata variable, using its flags | ||
5 | to determine the type and parameters for construction.""" | ||
6 | var_type = d.getVarFlag(key, 'type') | ||
7 | flags = d.getVarFlags(key) | ||
8 | if flags is not None: | ||
9 | flags = dict((flag, d.expand(value)) | ||
10 | for flag, value in flags.iteritems()) | ||
11 | else: | ||
12 | flags = {} | ||
13 | |||
14 | try: | ||
15 | return oe.maketype.create(d.getVar(key, True) or '', var_type, **flags) | ||
16 | except (TypeError, ValueError), exc: | ||
17 | bb.msg.fatal("Data", "%s: %s" % (key, str(exc))) | ||