Skip to content

Commit 01e16ca

Browse files
committed
Updated documentation
1 parent 2123019 commit 01e16ca

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,30 @@
22
* Enhancements
33
* Added support for and testing with Python 3.8, starting with 3.8 beta
44
* Improved information displayed during transcript testing
5+
* Added `ansi` module with functions and constants to support ANSI escape sequences which are used for things
6+
like applying style to text
7+
* Added support for applying styles (color, bold, underline) to text via `style()` function in `ansi` module
8+
* Added default styles to ansi.py for printing `success`, `warning`. and `error` text. These are the styles used
9+
by cmd2 and can be overridden to match the color scheme of your application.
10+
* Added `ansi_aware_write()` function to `ansi` module. This function takes into account the value of `allow_ansi`
11+
to determine if ANSI escape sequences should be stripped when not writing to a tty. See documentation for more
12+
information on the `allow_ansi` setting.
513
* Breaking Changes
614
* Python 3.4 reached its [end of life](https://www.python.org/dev/peps/pep-0429/) on March 18, 2019 and is no longer supported by `cmd2`
715
* If you need to use Python 3.4, you should pin your requirements to use `cmd2` 0.9.13
816
* Made lots of changes to minimize the public API of the `cmd2.Cmd` class
917
* Attributes and methods we do not intend to be public now all begin with an underscore
1018
* We make no API stability guarantees about these internal functions
19+
* Split `perror` into 2 functions:
20+
* `perror` - print a message to sys.stderr
21+
* `pexcept` - print Exception message to sys.stderr. If debug is true, print exception traceback if one exists.
22+
* Removed color parameters from `poutput` and `perror` since more powerful styles now exist. See the docstrings
23+
of these methods for more information on applying styles to output messages.
24+
* Moved `cmd2.Cmd.colors` to ansi.py and renamed it to `allow_ansi`. This is now an application-wide setting.
25+
* Renamed the following constants and moved them to ansi.py
26+
* `COLORS_ALWAYS` --> `ANSI_ALWAYS`
27+
* `COLORS_NEVER` --> `ANSI_NEVER`
28+
* `COLORS_TERMINAL` --> `ANSI_TERMINAL`
1129
* **Renamed Commands Notice**
1230
* The following commands have been renamed. The old names will be supported until the next release.
1331
* `load` --> `run_script`

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# import this module, many of these imports are lazy-loaded
2828
# i.e. we only import the module when we use it
2929
# For example, we don't import the 'traceback' module
30-
# until the perror() function is called and the debug
30+
# until the pexcept() function is called and the debug
3131
# setting is True
3232
import argparse
3333
import cmd

0 commit comments

Comments
 (0)