From a84d8750f10aa0d76029d88184d6b9960b257319 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 18 Jan 2014 14:24:13 +0000 Subject: [PATCH] bitbake: user-manual-metadata: Add section about data store operations (Bitbake rev: 85ffd05f292386de1b098debb6a3d3fe18c6b6b7) Signed-off-by: Richard Purdie --- bitbake/doc/user-manual/user-manual-metadata.xml | 69 ++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/bitbake/doc/user-manual/user-manual-metadata.xml b/bitbake/doc/user-manual/user-manual-metadata.xml index 53f677e..23b3fa6 100644 --- a/bitbake/doc/user-manual/user-manual-metadata.xml +++ b/bitbake/doc/user-manual/user-manual-metadata.xml @@ -741,4 +741,73 @@ python do_printdate () { + +
+ Accessing Variables and the Data Store from Python + + + It is often necessary to manipulate variables within python functions + and the Bitbake data store has an API which allows this. + The operations available are: + + d.getVar("X", expand=False) + + returns the value of variable "X", expanding the value + if specified. + + d.setVar("X", value) + + sets the value of "X" to "value". + + d.appendVar("X", value) + + adds "value" to the end of variable X. + + d.prependVar("X", value) + + adds "value" to the start of variable X. + + d.delVar("X") + + deletes the variable X from the data store. + + d.renameVar("X", "Y") + + renames variable X to Y. + + d.getVarFlag("X", flag, expand=False) + + gets given flag from variable X but does not expand it. + + d.setVarFlag("X", flag, value) + + sets given flag for variable X to value. + setVarFlags will not clear previous flags. + Think of this method as addVarFlags. + + d.appendVarFlag("X", flag, value) + + Need description. + + d.prependVarFlag("X", flag, value) + + Need description. + + d.delVarFlag("X", flag) + + Need description. + + d.setVarFlags("X", flagsdict) + + sets the flags specified in the dict() parameter. + + d.getVarFlags("X") + + returns a dict of the flags for X. + + d.delVarFlags + + deletes all the flags for a variable. + +
-- 2.7.4