Skip to content

Commit 1dd6d43

Browse files
committed
Removed terminal_utils.py.
Added documentation for completion.py.
1 parent 2a20619 commit 1dd6d43

10 files changed

Lines changed: 10 additions & 104 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ cmd2/argparse_*.py @kmvanbrunt @anselor
3131
cmd2/clipboard.py @tleonhardt
3232
cmd2/cmd2.py @tleonhardt @kmvanbrunt
3333
cmd2/colors.py @tleonhardt @kmvanbrunt
34-
cmd2/command_definition.py @anselor
34+
cmd2/command_definition.py @anselor @kmvanbrunt
35+
cmd2/completion.py @kmvanbrunt
3536
cmd2/constants.py @tleonhardt @kmvanbrunt
3637
cmd2/decorators.py @kmvanbrunt @anselor
3738
cmd2/exceptions.py @kmvanbrunt @anselor
@@ -43,7 +44,6 @@ cmd2/py_bridge.py @kmvanbrunt
4344
cmd2/rich_utils.py @kmvanbrunt
4445
cmd2/string_utils.py @kmvanbrunt
4546
cmd2/styles.py @tleonhardt @kmvanbrunt
46-
cmd2/terminal_utils.py @kmvanbrunt
4747
cmd2/transcript.py @tleonhardt
4848
cmd2/utils.py @tleonhardt @kmvanbrunt
4949

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ shell, and the option for a persistent bottom bar that can display realtime stat
4848
`Statement.redirect_to`.
4949
- Changed `StatementParser.parse_command_only()` to return a `PartialStatement` object.
5050
- Renamed `Macro.arg_list` to `Macro.args`.
51+
- Removed `terminal_utils.py` since `prompt-toolkit` provides this functionality.
5152
- Enhancements
5253
- New `cmd2.Cmd` parameters
5354
- **auto_suggest**: (boolean) if `True`, provide fish shell style auto-suggestions. These

cmd2/completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Provides classes and functions related to completion."""
1+
"""Provides classes and functions related to command-line completion."""
22

33
import re
44
import sys

docs/api/completion.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cmd2.completion
2+
3+
::: cmd2.completion

docs/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ incremented according to the [Semantic Version Specification](https://semver.org
1818
- [cmd2.colors](./colors.md) - StrEnum of all color names supported by the Rich library
1919
- [cmd2.command_definition](./command_definition.md) - supports the definition of commands in
2020
separate classes to be composed into cmd2.Cmd
21+
- [cmd2.completion](./completion.md) - classes and functions related to command-line completion
2122
- [cmd2.constants](./constants.md) - constants used in `cmd2`
2223
- [cmd2.decorators](./decorators.md) - decorators for `cmd2` commands
2324
- [cmd2.exceptions](./exceptions.md) - custom `cmd2` exceptions
@@ -30,6 +31,5 @@ incremented according to the [Semantic Version Specification](https://semver.org
3031
- [cmd2.rich_utils](./rich_utils.md) - common utilities to support Rich in cmd2 applications
3132
- [cmd2.string_utils](./string_utils.md) - string utility functions
3233
- [cmd2.styles](./styles.md) - cmd2-specific Rich styles and a StrEnum of their corresponding names
33-
- [cmd2.terminal_utils](./terminal_utils.md) - support for terminal control escape sequences
3434
- [cmd2.transcript](./transcript.md) - functions and classes for running and validating transcripts
3535
- [cmd2.utils](./utils.md) - various utility classes and functions

docs/api/terminal_utils.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/features/generating_output.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ following sections:
121121
- [cmd2.colors][]
122122
- [cmd2.rich_utils][]
123123
- [cmd2.string_utils][]
124-
- [cmd2.terminal_utils][]
125124

126125
The [color.py](https://github.com/python-cmd2/cmd2/blob/main/examples/color.py) example demonstrates
127126
all colors available to your `cmd2` application.

docs/upgrades.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ The major things users should be aware of when upgrading to 3.x are detailed in
6363
#### ansi
6464

6565
The functionality within the `cmd2.ansi` module has either been removed or changed to be based on
66-
`rich` and moved to one of the new modules: [cmd2.string_utils][], [cmd2.styles][], or
67-
[cmd2.terminal_utils][].
66+
`rich` and moved to one of the new modules: [cmd2.string_utils][] or [cmd2.styles][].
6867

6968
To ease the migration path from `cmd2` 2.x to 3.x, we have created the `cmd2-ansi` module which is a
7069
backport of the `cmd2.ansi` module present in `cmd2` 2.7.0 in a standalone fashion. Relevant links:
@@ -147,18 +146,6 @@ This includes functions for styling, aligning, and quoting/un-quoting text. See
147146
[getting_started.py](https://github.com/python-cmd2/cmd2/blob/main/examples/getting_started.py)
148147
example for a demonstration of how to use the common [cmd2.string_utils.stylize][] function.
149148

150-
#### terminal_utils
151-
152-
Support for terminal control escape sequences for things like setting the window title and
153-
asynchronous alerts has been moved from `cmd2.ansi` to the new [cmd2.terminal_utils][] module.
154-
155-
This isn't really intended to be used by end users, but is used by higher-level functionality that
156-
is intended to be used by end users such as [cmd2.Cmd.set_window_title][] and
157-
[cmd2.Cmd.async_alert][].
158-
159-
See [async_printing.py](https://github.com/python-cmd2/cmd2/blob/main/examples/async_printing.py)
160-
for an example of how to use this functionality in a `cmd2` application.
161-
162149
### Argparse HelpFormatter classes
163150

164151
`cmd2` now has 5 different Argparse HelpFormatter classes, all of which are based on the

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ nav:
200200
- api/clipboard.md
201201
- api/colors.md
202202
- api/command_definition.md
203+
- api/completion.md
203204
- api/constants.md
204205
- api/decorators.md
205206
- api/exceptions.md
@@ -211,7 +212,6 @@ nav:
211212
- api/rich_utils.md
212213
- api/string_utils.md
213214
- api/styles.md
214-
- api/terminal_utils.md
215215
- api/transcript.md
216216
- api/utils.md
217217
- Version Upgrades:

tests/test_terminal_utils.py

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)