diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-26 18:06:30 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-31 12:08:51 +0100 |
commit | 13fdd4ae5d5709332d84427ff8e60dc9ba62974f (patch) | |
tree | 92f9e97a2914139c46af87f2733486d3fdbfd65d /bitbake/lib/bb/parse/ast.py | |
parent | f7627e4f677c628bf25ccbf4973ac3e4cd986dee (diff) | |
download | openembedded-core-13fdd4ae5d5709332d84427ff8e60dc9ba62974f.tar.gz openembedded-core-13fdd4ae5d5709332d84427ff8e60dc9ba62974f.tar.bz2 openembedded-core-13fdd4ae5d5709332d84427ff8e60dc9ba62974f.zip |
bitbake/BBHandler: Save python functions into the dictonary
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index eb24e0ddd4..8763362cdf 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py @@ -137,7 +137,8 @@ class MethodNode: bb.data.setVar(self.func_name, '\n'.join(self.body), data) class PythonMethodNode(AstNode): - def __init__(self, root, body, fn): + def __init__(self, funcname, root, body, fn): + self.func_name = funcname self.root = root self.body = body self.fn = fn @@ -149,6 +150,9 @@ class PythonMethodNode(AstNode): if not bb.methodpool.parsed_module(self.root): text = '\n'.join(self.body) bb.methodpool.insert_method(self.root, text, self.fn) + bb.data.setVarFlag(self.func_name, "func", 1, data) + bb.data.setVarFlag(self.func_name, "python", 1, data) + bb.data.setVar(self.func_name, text, data) class MethodFlagsNode(AstNode): def __init__(self, key, m): @@ -270,8 +274,8 @@ def handleData(statements, groupd): def handleMethod(statements, func_name, lineno, fn, body): statements.append(MethodNode(func_name, body, lineno, fn)) -def handlePythonMethod(statements, root, body, fn): - statements.append(PythonMethodNode(root, body, fn)) +def handlePythonMethod(statements, funcname, root, body, fn): + statements.append(PythonMethodNode(funcname, root, body, fn)) def handleMethodFlags(statements, key, m): statements.append(MethodFlagsNode(key, m)) |