aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/methodpool.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-30 20:06:07 -0700
committerChris Larson <chris_larson@mentor.com>2010-03-30 20:06:09 -0700
commit424d7e267b009cc19b8503eadab782736d9597d0 (patch)
treeaeba768adb121e1f562bd6b39e6c7e2897d701e5 /lib/bb/methodpool.py
parent97da0cebbaf4dd1b46e58bd2e80cab6c007ae7c9 (diff)
downloadbitbake-424d7e267b009cc19b8503eadab782736d9597d0.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. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/methodpool.py')
-rw-r--r--lib/bb/methodpool.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/bb/methodpool.py b/lib/bb/methodpool.py
index f43c4a058..1485b1357 100644
--- a/lib/bb/methodpool.py
+++ b/lib/bb/methodpool.py
@@ -27,7 +27,7 @@
a method pool to do this task.
This pool will be used to compile and execute the functions. It
- will be smart enough to
+ will be smart enough to
"""
from bb.utils import better_compile, better_exec
@@ -43,8 +43,8 @@ def insert_method(modulename, code, fn):
Add code of a module should be added. The methods
will be simply added, no checking will be done
"""
- comp = better_compile(code, "<bb>", fn )
- better_exec(comp, __builtins__, code, fn)
+ comp = better_compile(code, modulename, fn )
+ better_exec(comp, None, code, fn)
# now some instrumentation
code = comp.co_names
@@ -59,7 +59,7 @@ def insert_method(modulename, code, fn):
def check_insert_method(modulename, code, fn):
"""
Add the code if it wasnt added before. The module
- name will be used for that
+ name will be used for that
Variables:
@modulename a short name e.g. base.bbclass
@@ -81,4 +81,4 @@ def get_parsed_dict():
"""
shortcut
"""
- return _parsed_methods
+ return _parsed_methods