aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/parse
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2005-05-17 18:04:46 +0000
committerHolger Hans Peter Freyther <zecke@selfish.org>2005-05-17 18:04:46 +0000
commitc7f7cfd506f504f658088bc0c7ee9f487d8a3d3f (patch)
tree4c031f0154c212f14bf3754236369324a472b260 /lib/bb/parse
parentf07abf6a9cd413ef71db0023288f5868a9d83ec6 (diff)
downloadbitbake-c7f7cfd506f504f658088bc0c7ee9f487d8a3d3f.tar.gz
bitbake data module abstraction:
-bb.data is now a delegate to hookable Data implementation. -bb.data.init() is the 'factory' method to create a instance of a concrete implementation. -Kill assumptions that bb.data.init() returns a {} (python dict) -Add the old Dictionary Based Implementation as data_dict.py
Diffstat (limited to 'lib/bb/parse')
-rw-r--r--lib/bb/parse/BBHandler.py4
-rw-r--r--lib/bb/parse/ConfHandler.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/bb/parse/BBHandler.py b/lib/bb/parse/BBHandler.py
index 70d84cb06..7ff3909ad 100644
--- a/lib/bb/parse/BBHandler.py
+++ b/lib/bb/parse/BBHandler.py
@@ -64,7 +64,7 @@ def inherit(files, d):
data.setVar('__inherit_cache', __inherit_cache, d)
-def handle(fn, d = {}, include = 0):
+def handle(fn, d = data.init(), include = 0):
global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __bbpath_found__, __residue__
__body__ = []
__bbpath_found__ = 0
@@ -156,7 +156,7 @@ def handle(fn, d = {}, include = 0):
set_additional_vars(fn, d, include)
data.update_data(d)
- for var in d.keys():
+ for var in data.keys(d):
if data.getVarFlag(var, 'handler', d):
bb.event.register(data.getVar(var, d))
continue
diff --git a/lib/bb/parse/ConfHandler.py b/lib/bb/parse/ConfHandler.py
index 43cdec665..c001044b8 100644
--- a/lib/bb/parse/ConfHandler.py
+++ b/lib/bb/parse/ConfHandler.py
@@ -51,7 +51,7 @@ def localpath(fn, d):
localfn = fn
return localfn
-def obtain(fn, data = {}):
+def obtain(fn, data = bb.data.init()):
import sys, bb
fn = bb.data.expand(fn, data)
localfn = bb.data.expand(localpath(fn, data), data)
@@ -82,7 +82,7 @@ def obtain(fn, data = {}):
return localfn
-def include(oldfn, fn, data = {}):
+def include(oldfn, fn, data = bb.data.init()):
if oldfn == fn: # prevent infinate recursion
return None
@@ -96,7 +96,7 @@ def include(oldfn, fn, data = {}):
except IOError:
debug(2, "CONF file '%s' not found" % fn)
-def handle(fn, data = {}, include = 0):
+def handle(fn, data = bb.data.init(), include = 0):
if include:
inc_string = "including"
else:
@@ -153,7 +153,7 @@ def handle(fn, data = {}, include = 0):
bb.data.setVar('FILE', oldfile, data)
return data
-def feeder(lineno, s, fn, data = {}):
+def feeder(lineno, s, fn, data = bb.data.init()):
m = __config_regexp__.match(s)
if m:
groupd = m.groupdict()