summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2014-02-10 20:25:53 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-09 18:59:02 -0700
commit1d9c02e878937b1bb35cf44c5f0291400ef485ba (patch)
tree3583e9f4905d39015d57febf44283a125f12f0a9
parent666a7b09241373731c1c2cd204a795e02f29d93d (diff)
downloadpoky-1d9c02e878937b1bb35cf44c5f0291400ef485ba.tar.gz
bitbake: user-manual-metadata.xml: Rewrite "Accessing Datastore Variables Using Python"
Rewrote this section. Used a table instead of the funky list that was there. I still need to format it some. Also fixed up the term "datastore". It should not be "data store" (Bitbake rev: ee23839596102ccd58e028c10471438f2eb37feb) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/doc/user-manual/user-manual-metadata.xml152
1 files changed, 87 insertions, 65 deletions
diff --git a/bitbake/doc/user-manual/user-manual-metadata.xml b/bitbake/doc/user-manual/user-manual-metadata.xml
index 80e5b648db..a7d9209560 100644
--- a/bitbake/doc/user-manual/user-manual-metadata.xml
+++ b/bitbake/doc/user-manual/user-manual-metadata.xml
@@ -369,7 +369,7 @@
369 <title>Key Expansion</title> 369 <title>Key Expansion</title>
370 370
371 <para> 371 <para>
372 Key expansion happens when the BitBake data store is finalized 372 Key expansion happens when the BitBake datastore is finalized
373 just before BitBake expands overrides. 373 just before BitBake expands overrides.
374 To better understand this, consider the following example: 374 To better understand this, consider the following example:
375 <literallayout class='monospaced'> 375 <literallayout class='monospaced'>
@@ -1640,72 +1640,94 @@
1640 </section> 1640 </section>
1641 </section> 1641 </section>
1642 1642
1643 <section id='accessing-variables-and-the-data-store-from-python'> 1643 <section id='accessing-datastore-variables-using-python'>
1644 <title>Accessing Variables and the Data Store from Python</title> 1644 <title>Accessing Datastore Variables Using Python</title>
1645 1645
1646 <para> 1646 <para>
1647 It is often necessary to manipulate variables within python functions 1647 It is often necessary to access variables in the
1648 and the Bitbake data store has an API which allows this. 1648 BitBake datastore using Python functions.
1649 The operations available are: 1649 The Bitbake datastore has an API that allows you this
1650 <literallayout class='monospaced'> 1650 access.
1651 d.getVar("X", expand=False) 1651 Here is a list of available operations:
1652 </literallayout> 1652 </para>
1653 returns the value of variable "X", expanding the value 1653
1654 if specified. 1654 <para>
1655 <literallayout class='monospaced'> 1655 <informaltable frame='none'>
1656 d.setVar("X", value) 1656 <tgroup cols='2' align='left' colsep='1' rowsep='1'>
1657 </literallayout> 1657 <colspec colname='c1' colwidth='1*'/>
1658 sets the value of "X" to "value". 1658 <colspec colname='c2' colwidth='1*'/>
1659 <literallayout class='monospaced'> 1659 <thead>
1660 d.appendVar("X", value) 1660 <row>
1661 </literallayout> 1661 <entry align="left"><emphasis>Operation</emphasis></entry>
1662 adds "value" to the end of variable X. 1662 <entry align="left"><emphasis>Description</emphasis></entry>
1663 <literallayout class='monospaced'> 1663 </row>
1664 d.prependVar("X", value) 1664 </thead>
1665 </literallayout> 1665 <tbody>
1666 adds "value" to the start of variable X. 1666 <row>
1667 <literallayout class='monospaced'> 1667 <entry align="left"><filename>d.getVar("X", expand=False)</filename></entry>
1668 d.delVar("X") 1668 <entry align="left">Returns the value of variable "X".
1669 </literallayout> 1669 Using "expand=True" expands the value.</entry>
1670 deletes the variable X from the data store. 1670 </row>
1671 <literallayout class='monospaced'> 1671 <row>
1672 d.renameVar("X", "Y") 1672 <entry align="left"><filename>d.setVar("X", value)</filename></entry>
1673 </literallayout> 1673 <entry align="left">Sets the variable "X" to "value".</entry>
1674 renames variable X to Y. 1674 </row>
1675 <literallayout class='monospaced'> 1675 <row>
1676 d.getVarFlag("X", flag, expand=False) 1676 <entry align="left"><filename>d.appendVar("X", value)</filename></entry>
1677 </literallayout> 1677 <entry align="left">Adds "value" to the end of the variable "X".</entry>
1678 gets given flag from variable X but does not expand it. 1678 </row>
1679 <literallayout class='monospaced'> 1679 <row>
1680 d.setVarFlag("X", flag, value) 1680 <entry align="left"><filename>d.prependVar("X", value)</filename></entry>
1681 </literallayout> 1681 <entry align="left">Adds "value" to the start of the variable "X".</entry>
1682 sets given flag for variable X to value. 1682 </row>
1683 <filename>setVarFlags</filename> will not clear previous flags. 1683 <row>
1684 Think of this method as <filename>addVarFlags</filename>. 1684 <entry align="left"><filename>d.delVar("X")</filename></entry>
1685 <literallayout class='monospaced'> 1685 <entry align="left">Deletes the variable "X" from the datastore.</entry>
1686 d.appendVarFlag("X", flag, value) 1686 </row>
1687 </literallayout> 1687 <row>
1688 Need description. 1688 <entry align="left"><filename>d.renameVar("X", "Y")</filename></entry>
1689 <literallayout class='monospaced'> 1689 <entry align="left">Renames the variable "X" to "Y".</entry>
1690 d.prependVarFlag("X", flag, value) 1690 </row>
1691 </literallayout> 1691 <row>
1692 Need description. 1692 <entry align="left"><filename>d.getVarFlag("X", flag, expand=False)</filename></entry>
1693 <literallayout class='monospaced'> 1693 <entry align="left">Gets "flag" from the variable "X".
1694 d.delVarFlag("X", flag) 1694 Using "expand=True" expands the flag.</entry>
1695 </literallayout> 1695 </row>
1696 Need description. 1696 <row>
1697 <literallayout class='monospaced'> 1697 <entry align="left"><filename>d.setVarFlag("X", flag, value)</filename></entry>
1698 d.setVarFlags("X", flagsdict) 1698 <entry align="left">Sets "flag" for variable "X" to "value".
1699 </literallayout> 1699 <filename>setVarFlags</filename> does not clear previous flags.
1700 sets the flags specified in the <filename>dict()</filename> parameter. 1700 Think of this operation as <filename>addVarFlags</filename>.</entry>
1701 <literallayout class='monospaced'> 1701 </row>
1702 d.getVarFlags("X") 1702 <row>
1703 </literallayout> 1703 <entry align="left"><filename>d.appendVarFlag("X", flag, value)</filename></entry>
1704 returns a <filename>dict</filename> of the flags for X. 1704 <entry align="left">Need description.</entry>
1705 <literallayout class='monospaced'> 1705 </row>
1706 d.delVarFlags 1706 <row>
1707 </literallayout> 1707 <entry align="left"><filename>d.prependVarFlag("X", flag, value)</filename></entry>
1708 deletes all the flags for a variable. 1708 <entry align="left">Need description.</entry>
1709 </row>
1710 <row>
1711 <entry align="left"><filename>d.delVarFlag("X", flag)</filename></entry>
1712 <entry align="left">Need description.</entry>
1713 </row>
1714 <row>
1715 <entry align="left"><filename>d.setVarFlags("X", flagsdict)</filename></entry>
1716 <entry align="left">Sets the flags specified in
1717 the <filename>dict()</filename> parameter.</entry>
1718 </row>
1719 <row>
1720 <entry align="left"><filename>d.getVarFlags("X")</filename></entry>
1721 <entry align="left">Returns a <filename>dict</filename> of the flags for
1722 the variable "X".</entry>
1723 </row>
1724 <row>
1725 <entry align="left"><filename>d.delVarFlags</filename></entry>
1726 <entry align="left">Deletes all the flags for a variable.</entry>
1727 </row>
1728 </tbody>
1729 </tgroup>
1730 </informaltable>
1709 </para> 1731 </para>
1710 </section> 1732 </section>
1711 1733