aboutsummaryrefslogtreecommitdiff
path: root/tools/u_boot_pylib/terminal.py
AgeCommit message (Collapse)AuthorFilesLines
2025-05-27u_boot_pylib: Add a pagerSimon Glass1-1/+36
It is useful to have a pager when outputting a lot of text. Add support for this in the terminal library, making use of a context manager. Also add a function to indicate whether the output device is a terminal or not, while we are here, to avoid duplicating this code. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27u_boot_pylib: Improve ANSI-colour output with backgroundsSimon Glass1-15/+23
The current implementation does not handle background colours very well: - It outputs an incorrect code in some cases, leading to wrong colours - Some functions lack a control for the background Tidy this up so that background colours can be used in more places. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27u_boot_pylib: Allow control of capturingSimon Glass1-0/+14
Tests often capture output so they can check it. This means that if the test fails it is not easy to see what the output actually was. Add a -N flag which writes out the output after it has been captured. This is not a perfect solution but it is simple and seems to work well in practice. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Move capture_sys_output() into terminal and renameSimon Glass1-0/+16
This function is sometimes useful outside tests. Also it can affect how terminal output is done, e.g. whether ANSI characters should be emitted or not. Move it out of the test_util package and into terminal. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-03buildman: Add a way to limit the number of buildmansSimon Glass1-2/+5
Buildman uses all available CPUs by default, so running more than one or two concurrent processes is not normally useful. However in some CI cases we want to be able to run several jobs at once to save time. For example, in a lab situation we may want to run a test on 20 boards at a time, since only the build step actually takes much CPU. Add an option which allows such a limit. When buildman starts up, it waits until the number of running processes goes below the limit, then claims a spot in the list. The list is maintained with a temporary file. Note that the temp file is user-specific, since it is hard to create a locked temporary file which can be accessed by any user. In most cases, only one user is running jobs on a machine, so this should not matter. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08patman: Move library functions into a library directorySimon Glass1-0/+270
The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>