Debian Codegraph @

demos/demo.sh

raw
1 #!/usr/bin/env bash
2 # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
3
4 # Script to demonstrate features of colorama.
5
6 # This demo is also used to verify correctness visually, because we don't have
7 # automated tests.
8
9 # Implemented as a bash script which invokes python so that we can test the
10 # behaviour on exit, which resets default colors again.
11
12 # print grid of all colors and brightnesses
13 python demo01.py
14
15 # Simple demo of changing foreground, background and brightness.
16 python demo02.py
17
18 # Demonstrate the different behavior when autoreset is True and False.
19 python demo03.py
20
21 # check that stripped ANSI in redirected stderr does not affect stdout
22 rm -f demo04.out
23 python demo04.py 2> demo04.out
24 cat demo04.out
25 rm -f demo04.out
26
27 # Demonstrate the difference between colorama initialized with wrapping on and off.
28 python demo05.py
29
30 # Skip demo06
31 # It is too visually disruptive,
32 # making it hard to see whether any of the demos are working correctly.
33
34 # Demonstrate cursor relative movement: UP, DOWN, FORWARD, and BACK in colorama.CURSOR
35 python demo07.py
36
37 # Demonstrate the use of a context manager instead of manually using init and deinit
38 python demo08.py