From: Richard Purdie Date: Sat, 18 Jan 2014 14:24:13 +0000 (+0000) Subject: user-manual-metadata: Add section about data store operations X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85ffd05f292386de1b098debb6a3d3fe18c6b6b7;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git user-manual-metadata: Add section about data store operations Signed-off-by: Richard Purdie --- diff --git a/doc/user-manual/user-manual-metadata.xml b/doc/user-manual/user-manual-metadata.xml index 53f677e2f3e..23b3fa67d31 100644 --- a/doc/user-manual/user-manual-metadata.xml +++ b/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. + +