diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-03-30 20:06:07 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:31 +0100 |
commit | 94b60d1247be4ce42eaefafe13e73169bd978bd7 (patch) | |
tree | 3a8ed098cc96b5ee63c6652c8d49cda6c99a5524 /bitbake/lib/bb/data_smart.py | |
parent | eb167737041d8754988d153e0495268f03b6e809 (diff) | |
download | poky-94b60d1247be4ce42eaefafe13e73169bd978bd7.tar.gz |
Consolidate the exec/eval bits, switch anonfunc to better_exec, etc
The methodpool, ${@} expansions, anonymous python functions, event handlers
now all run with the same global context, ensuring a consistent environment
for them. Added a bb.utils.better_eval function which does an eval() with the
same globals as better_exec.
(Bitbake rev: 424d7e267b009cc19b8503eadab782736d9597d0)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 55a6f3143c..77f1861381 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -50,12 +50,6 @@ class DataSmart: | |||
50 | self._seen_overrides = seen | 50 | self._seen_overrides = seen |
51 | 51 | ||
52 | self.expand_cache = {} | 52 | self.expand_cache = {} |
53 | self.expand_globals = { | ||
54 | "os": os, | ||
55 | "bb": bb, | ||
56 | "time": time, | ||
57 | "d": self | ||
58 | } | ||
59 | 53 | ||
60 | def expand(self,s, varname): | 54 | def expand(self,s, varname): |
61 | def var_sub(match): | 55 | def var_sub(match): |
@@ -72,7 +66,7 @@ class DataSmart: | |||
72 | def python_sub(match): | 66 | def python_sub(match): |
73 | code = match.group()[3:-1] | 67 | code = match.group()[3:-1] |
74 | codeobj = compile(code.strip(), varname or "<expansion>", "eval") | 68 | codeobj = compile(code.strip(), varname or "<expansion>", "eval") |
75 | s = eval(codeobj, self.expand_globals, {}) | 69 | s = utils.better_eval(codeobj, {"d": self}) |
76 | if type(s) == types.IntType: s = str(s) | 70 | if type(s) == types.IntType: s = str(s) |
77 | return s | 71 | return s |
78 | 72 | ||