Skip to content

Commit ce26917

Browse files
committed
Update docs with smart ANSI handling for ppaged
1 parent 607106c commit ce26917

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

docs/unfreefeatures.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,20 @@ The output methods in the previous section all honor the ``colors`` setting,
146146
which has three possible values:
147147

148148
Never
149-
poutput() and pfeedback() strip all ANSI escape sequences
149+
poutput(), pfeedback(), and ppaged() strip all ANSI escape sequences
150150
which instruct the terminal to colorize output
151151

152152
Terminal
153-
(the default value) poutput() and pfeedback() do not strip any ANSI escape
154-
sequences when the output is a terminal, but if the output is a pipe or a
155-
file the escape sequences are stripped. If you want colorized output you
156-
must add ANSI escape sequences, preferably using some python color library
157-
like `plumbum.colors`, `colorama`, `blessings`, or `termcolor`.
153+
(the default value) poutput(), pfeedback(), and ppaged() do not strip any
154+
ANSI escape sequences when the output is a terminal, but if the output is
155+
a pipe or a file the escape sequences are stripped. If you want colorized
156+
output you must add ANSI escape sequences, preferably using some python
157+
color library like `plumbum.colors`, `colorama`, `blessings`, or
158+
`termcolor`.
158159

159160
Always
160-
poutput() and pfeedback() never strip ANSI escape sequences, regardless of
161-
the output destination
161+
poutput(), pfeedback(), and ppaged() never strip ANSI escape sequences,
162+
regardless of the output destination
162163

163164

164165
.. _quiet:

examples/colors.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
The colors setting has three possible values:
1010
1111
Never
12-
poutput() and pfeedback() strip all ANSI escape sequences
12+
poutput(), pfeedback(), and ppaged() strip all ANSI escape sequences
1313
which instruct the terminal to colorize output
1414
1515
Terminal
16-
(the default value) poutput() and pfeedback() do not strip any ANSI escape
17-
sequences when the output is a terminal, but if the output is a pipe or a
18-
file the escape sequences are stripped. If you want colorized output you
19-
must add ANSI escape sequences, preferably using some python color library
20-
like `plumbum.colors`, `colorama`, `blessings`, or `termcolor`.
16+
(the default value) poutput(), pfeedback(), and ppaged() do not strip any
17+
ANSI escape sequences when the output is a terminal, but if the output is
18+
a pipe or a file the escape sequences are stripped. If you want colorized
19+
output you must add ANSI escape sequences, preferably using some python
20+
color library like `plumbum.colors`, `colorama`, `blessings`, or
21+
`termcolor`.
2122
2223
Always
23-
poutput() and pfeedback() never strip ANSI escape sequences, regardless of
24-
the output destination
24+
poutput(), pfeedback(), and ppaged() never strip ANSI escape sequences,
25+
regardless of the output destination
2526
"""
2627

2728
import random

examples/plumbum_colors.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
The colors setting has three possible values:
1010
1111
Never
12-
poutput() and pfeedback() strip all ANSI escape sequences
12+
poutput(), pfeedback(), and ppaged() strip all ANSI escape sequences
1313
which instruct the terminal to colorize output
1414
1515
Terminal
16-
(the default value) poutput() and pfeedback() do not strip any ANSI escape
17-
sequences when the output is a terminal, but if the output is a pipe or a
18-
file the escape sequences are stripped. If you want colorized output you
19-
must add ANSI escape sequences, preferably using some python color library
20-
like `plumbum.colors`, `colorama`, `blessings`, or `termcolor`.
16+
(the default value) poutput(), pfeedback(), and ppaged() do not strip any
17+
ANSI escape sequences when the output is a terminal, but if the output is
18+
a pipe or a file the escape sequences are stripped. If you want colorized
19+
output you must add ANSI escape sequences, preferably using some python
20+
color library like `plumbum.colors`, `colorama`, `blessings`, or
21+
`termcolor`.
2122
2223
Always
23-
poutput() and pfeedback() never strip ANSI escape sequences, regardless of
24-
the output destination
24+
poutput(), pfeedback(), and ppaged() never strip ANSI escape sequences,
25+
regardless of the output destination
2526
2627
WARNING: This example requires the plumbum package, which isn't normally required by cmd2.
2728
"""

0 commit comments

Comments
 (0)