From 945c669138a76be18c6b4da4f8f907d2a5cfd83f Mon Sep 17 00:00:00 2001 From: Michael Opdenacker Date: Thu, 24 Nov 2022 17:50:52 +0100 Subject: manuals: split dev-manual/common-tasks.rst A 500 KB source file is always harder to manage, and can have section title conflicts. So, the "Common Tasks" document is gone and all its constituents are moved up one level. You now have 40 chapters in the Development Tasks Manual. (From yocto-docs rev: 8a45bc469411410020b8e688c137395fcaf3761b) Signed-off-by: Michael Opdenacker Signed-off-by: Richard Purdie --- .../dev-manual/python-development-shell.rst | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 documentation/dev-manual/python-development-shell.rst (limited to 'documentation/dev-manual/python-development-shell.rst') diff --git a/documentation/dev-manual/python-development-shell.rst b/documentation/dev-manual/python-development-shell.rst new file mode 100644 index 0000000000..1b213318a5 --- /dev/null +++ b/documentation/dev-manual/python-development-shell.rst @@ -0,0 +1,50 @@ +.. SPDX-License-Identifier: CC-BY-SA-2.0-UK + +Using a Python Development Shell +******************************** + +Similar to working within a development shell as described in the +previous section, you can also spawn and work within an interactive +Python development shell. When debugging certain commands or even when +just editing packages, ``pydevshell`` can be a useful tool. When you +invoke the ``pydevshell`` task, all tasks up to and including +:ref:`ref-tasks-patch` are run for the +specified target. Then a new terminal is opened. Additionally, key +Python objects and code are available in the same way they are to +BitBake tasks, in particular, the data store 'd'. So, commands such as +the following are useful when exploring the data store and running +functions:: + + pydevshell> d.getVar("STAGING_DIR") + '/media/build1/poky/build/tmp/sysroots' + pydevshell> d.getVar("STAGING_DIR", False) + '${TMPDIR}/sysroots' + pydevshell> d.setVar("FOO", "bar") + pydevshell> d.getVar("FOO") + 'bar' + pydevshell> d.delVar("FOO") + pydevshell> d.getVar("FOO") + pydevshell> bb.build.exec_func("do_unpack", d) + pydevshell> + +See the ":ref:`bitbake:bitbake-user-manual/bitbake-user-manual-metadata:functions you can call from within python`" +section in the BitBake User Manual for details about available functions. + +The commands execute just as if the OpenEmbedded build +system were executing them. Consequently, working this way can be +helpful when debugging a build or preparing software to be used with the +OpenEmbedded build system. + +Following is an example that uses ``pydevshell`` on a target named +``matchbox-desktop``:: + + $ bitbake matchbox-desktop -c pydevshell + +This command spawns a terminal and places you in an interactive Python +interpreter within the OpenEmbedded build environment. The +:term:`OE_TERMINAL` variable +controls what type of shell is opened. + +When you are finished using ``pydevshell``, you can exit the shell +either by using Ctrl+d or closing the terminal window. + -- cgit v1.2.3-54-g00ecf