aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-02-09 10:28:42 -0700
committerChris Larson <chris_larson@mentor.com>2011-02-09 12:10:45 -0700
commit2fbd56c0ef7df1b45746dbf9390805f2e67c590b (patch)
treea549ae6d6eb2783e5d2390f4bb7e007af551464f /classes
parentf41d2fdfa6fc443353aec43eec0bfdf5c4dbb5f8 (diff)
downloadopenembedded-2fbd56c0ef7df1b45746dbf9390805f2e67c590b.tar.gz
More sane naming for the variable typing code
oe.types.value -> oe.data.typed_value This name has been bugging me. This function is the primary interface to the module for OE metadata, as it takes a variable name and datastore and returns an object of the correct type. While this function is part of the variable typing implementation, in reality it's more about giving you a useful object from the metadata, so I think oe.data is a more appropriate place for it. oe.types -> oe.maketype These are the functions which construct types, not the types themselves, so it was somewhat misleading. oe._types -> oe.types These are the actual types, any callable in this module becomes an OE type, using its arguments to determine the variable flags (optional and required) to obey. Will use __init__'s args in the case of an actual python class. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/base.bbclass14
-rw-r--r--classes/typecheck.bbclass3
2 files changed, 8 insertions, 9 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index b550874431..45febc95a7 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -10,7 +10,7 @@ inherit utils
inherit utility-tasks
inherit metadata_scm
-OE_IMPORTS += "oe.path oe.utils oe.packagegroup oe.types sys os time"
+OE_IMPORTS += "oe.path oe.utils oe.packagegroup oe.data sys os time"
OE_IMPORTS[type] = "list"
python oe_import () {
@@ -86,7 +86,7 @@ python base_scenefunction () {
}
python base_do_setscene () {
- for func in oe.types.value('SCENEFUNCS', d):
+ for func in oe.data.typed_value('SCENEFUNCS', d):
bb.build.exec_func(func, d)
if not os.path.exists(bb.data.getVar('STAMP', d, 1) + ".do_setscene"):
bb.build.make_stamp("do_setscene", d)
@@ -102,7 +102,7 @@ python base_do_fetch() {
localdata = bb.data.createCopy(d)
bb.data.update_data(localdata)
- src_uri = oe.types.value('SRC_URI', localdata)
+ src_uri = oe.data.typed_value('SRC_URI', localdata)
if not src_uri:
return 1
try:
@@ -192,11 +192,11 @@ do_unpack[dirs] = "${WORKDIR}"
python base_do_unpack() {
from glob import glob
- src_uri = oe.types.value("SRC_URI", d)
+ src_uri = oe.data.typed_value("SRC_URI", d)
if not src_uri:
return
srcurldata = bb.fetch.init(src_uri, d, True)
- filespath = oe.types.value("FILESPATH", d)
+ filespath = oe.data.typed_value("FILESPATH", d)
for url in src_uri:
urldata = srcurldata[url]
@@ -263,7 +263,7 @@ python build_summary() {
else:
print statusmsg
- needed_vars = oe.types.value("BUILDCFG_NEEDEDVARS", e.data)
+ needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", e.data)
pesteruser = []
for v in needed_vars:
val = bb.data.getVar(v, e.data, 1)
@@ -328,7 +328,7 @@ def set_multimach_arch(d):
multiarch = pkg_arch
- for pkg in oe.types.value('PACKAGES', d):
+ for pkg in oe.data.typed_value('PACKAGES', d):
pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1)
# We could look for != PACKAGE_ARCH here but how to choose
diff --git a/classes/typecheck.bbclass b/classes/typecheck.bbclass
index 646cd4eed2..bacaad8691 100644
--- a/classes/typecheck.bbclass
+++ b/classes/typecheck.bbclass
@@ -3,10 +3,9 @@
# See oe.types for details.
python check_types() {
- import oe.types
if isinstance(e, bb.event.ConfigParsed):
for key in e.data.keys():
if e.data.getVarFlag(key, "type"):
- oe.types.value(key, e.data)
+ oe.data.typed_value(key, e.data)
}
addhandler check_types