summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/ast.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r--bitbake/lib/bb/parse/ast.py10
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:
137 bb.data.setVar(self.func_name, '\n'.join(self.body), data) 137 bb.data.setVar(self.func_name, '\n'.join(self.body), data)
138 138
139class PythonMethodNode(AstNode): 139class PythonMethodNode(AstNode):
140 def __init__(self, root, body, fn): 140 def __init__(self, funcname, root, body, fn):
141 self.func_name = funcname
141 self.root = root 142 self.root = root
142 self.body = body 143 self.body = body
143 self.fn = fn 144 self.fn = fn
@@ -149,6 +150,9 @@ class PythonMethodNode(AstNode):
149 if not bb.methodpool.parsed_module(self.root): 150 if not bb.methodpool.parsed_module(self.root):
150 text = '\n'.join(self.body) 151 text = '\n'.join(self.body)
151 bb.methodpool.insert_method(self.root, text, self.fn) 152 bb.methodpool.insert_method(self.root, text, self.fn)
153 bb.data.setVarFlag(self.func_name, "func", 1, data)
154 bb.data.setVarFlag(self.func_name, "python", 1, data)
155 bb.data.setVar(self.func_name, text, data)
152 156
153class MethodFlagsNode(AstNode): 157class MethodFlagsNode(AstNode):
154 def __init__(self, key, m): 158 def __init__(self, key, m):
@@ -270,8 +274,8 @@ def handleData(statements, groupd):
270def handleMethod(statements, func_name, lineno, fn, body): 274def handleMethod(statements, func_name, lineno, fn, body):
271 statements.append(MethodNode(func_name, body, lineno, fn)) 275 statements.append(MethodNode(func_name, body, lineno, fn))
272 276
273def handlePythonMethod(statements, root, body, fn): 277def handlePythonMethod(statements, funcname, root, body, fn):
274 statements.append(PythonMethodNode(root, body, fn)) 278 statements.append(PythonMethodNode(funcname, root, body, fn))
275 279
276def handleMethodFlags(statements, key, m): 280def handleMethodFlags(statements, key, m):
277 statements.append(MethodFlagsNode(key, m)) 281 statements.append(MethodFlagsNode(key, m))