diff options
Diffstat (limited to 'bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst')
-rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst index ba8129afab..b35c332c82 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | |||
@@ -1972,6 +1972,24 @@ looking at the source code of the ``bb`` module, which is in | |||
1972 | the commonly used functions ``bb.utils.contains()`` and | 1972 | the commonly used functions ``bb.utils.contains()`` and |
1973 | ``bb.utils.mkdirhier()``, which come with docstrings. | 1973 | ``bb.utils.mkdirhier()``, which come with docstrings. |
1974 | 1974 | ||
1975 | Extending Python Library Code | ||
1976 | ----------------------------- | ||
1977 | |||
1978 | If you wish to add your own Python library code (e.g. to provide | ||
1979 | functions/classes you can use from Python functions in the metadata) | ||
1980 | you can do so from any layer using the ``addpylib`` directive. | ||
1981 | This directive is typically added to your layer configuration ( | ||
1982 | ``conf/layer.conf``) although it will be handled in any ``.conf`` file. | ||
1983 | |||
1984 | Usage is of the form:: | ||
1985 | |||
1986 | addpylib <directory> <namespace> | ||
1987 | |||
1988 | Where <directory> specifies the directory to add to the library path. | ||
1989 | The specified <namespace> is imported automatically, and if the imported | ||
1990 | module specifies an attribute named ``BBIMPORTS``, that list of | ||
1991 | sub-modules is iterated and imported too. | ||
1992 | |||
1975 | Testing and Debugging BitBake Python code | 1993 | Testing and Debugging BitBake Python code |
1976 | ----------------------------------------- | 1994 | ----------------------------------------- |
1977 | 1995 | ||