Skip to content

Commit 4cb1ee5

Browse files
committed
Updated CHANGELOG.md
Also improved some docstring whitespace in examples/async_call.py
1 parent f4ce818 commit 4cb1ee5

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ shell, and the option for a persistent bottom bar that can display realtime stat
2121
each platform and provided utility functions related to `readline`
2222
- Added a dependency on `prompt-toolkit` and a new `cmd2.pt_utils` module with supporting
2323
utilities
24+
- Async specific: `prompt-toolkit` starts its own `asyncio` event loop in every `cmd2`
25+
application
26+
- Enhancements
27+
- Optional persistent **bottom toolbar** capable of displaying realtime status information, see
28+
the `include_bottom_toolbar` optional argument to the initializer for `cmd2.Cmd` and the
29+
`cmd2.Cmd2._bottom_toolbar` method that can be overridden as well as the updated
30+
`getting_started.py` example
2431

2532
## 3.1.0 (December 25, 2025)
2633

examples/async_call.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313

1414
def run_async(coro) -> concurrent.futures.Future:
15-
"""
16-
Await a coroutine from a synchronous function/method.
17-
"""
15+
"""Await a coroutine from a synchronous function/method."""
1816

1917
global _event_loop # noqa: PLW0603
2018

@@ -33,22 +31,21 @@ def run_async(coro) -> concurrent.futures.Future:
3331

3432

3533
async def async_wait(duration: float) -> float:
36-
"""
37-
Example async function that is called from a synchronous cmd2 command
38-
"""
34+
"""Example async function that is called from a synchronous cmd2 command"""
3935
await asyncio.sleep(duration)
4036
return duration
4137

4238

4339
class AsyncCallExample(cmd2.Cmd):
44-
"""
45-
A simple cmd2 application.
40+
"""A simple cmd2 application.
41+
4642
Demonstrates how to run an async function from a cmd2 command.
4743
"""
4844

4945
def do_async_wait(self, _: str) -> None:
50-
"""
51-
Waits asynchronously. Example cmd2 command that calls an async function.
46+
"""Waits asynchronously.
47+
48+
Example cmd2 command that calls an async function.
5249
"""
5350

5451
waitable = run_async(async_wait(0.1))
@@ -59,16 +56,15 @@ def do_async_wait(self, _: str) -> None:
5956
return
6057

6158
def do_hello_world(self, _: str) -> None:
62-
"""
63-
Prints a simple greeting. Just a typical (synchronous) cmd2 command
59+
"""Prints a simple greeting.
60+
61+
Just a typical (synchronous) cmd2 command
6462
"""
6563
self.poutput('Hello World')
6664

6765

6866
def main() -> int:
69-
"""
70-
Main entry point for the example.
71-
"""
67+
"""Main entry point for the example."""
7268
app = AsyncCallExample()
7369
app.set_window_title("Call to an Async Function Test")
7470
return app.cmdloop()

0 commit comments

Comments
 (0)