Skip to content

Commit a3d224f

Browse files
committed
Fixed references to get_theme() and set_theme().
1 parent 0f91f79 commit a3d224f

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ prompt is displayed.
9595
- `RawTextCmd2HelpFormatter`
9696
- `TextGroup`
9797
- Replaced the global `APP_THEME` constant in `rich_utils.py` with `get_theme()` and
98-
`set_theme()` functions to support lazy initialization and safer in-place updates of the
99-
theme.
98+
`set_theme()` functions in `theme.py` to support lazy initialization and safer in-place
99+
updates of the theme.
100100
- Renamed `Cmd._command_parsers` to `Cmd.command_parsers`.
101101
- Removed `RichPrintKwargs` `TypedDict` in favor of using `Mapping[str, Any]`, allowing for
102102
greater flexibility in passing keyword arguments to `console.print()` calls.

cmd2/styles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
their own default styles.
1515
1616
For a complete theming experience, you can create a custom theme that includes
17-
styles from Rich and rich-argparse. The `cmd2.rich_utils.set_theme()` function
17+
styles from Rich and rich-argparse. The `cmd2.theme.set_theme()` function
1818
automatically updates rich-argparse's styles with any custom styles provided in
1919
your theme dictionary, so you don't have to modify them directly.
2020

docs/upgrades.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ periodically.
5252
customize its appearance using the `cmd2` theme.
5353

5454
- **Customization**: Override the `Cmd2Style.COMPLETION_MENU_CURRENT` and
55-
`Cmd2Style.COMPLETION_MENU_META` styles using `cmd2.rich_utils.set_theme()`. See
55+
`Cmd2Style.COMPLETION_MENU_META` styles using `cmd2.theme.set_theme()`. See
5656
[Customizing Completion Menu Colors](features/theme.md#customizing-completion-menu-colors) for
5757
more details.
5858

examples/rich_theme.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
from rich.style import Style
55

66
import cmd2
7-
import cmd2.rich_utils as ru
8-
from cmd2 import Cmd2Style, Color
7+
from cmd2 import Cmd2Style, Color, set_theme
98

109

1110
class ThemedApp(cmd2.Cmd):
@@ -42,7 +41,7 @@ def __init__(self, *args, **kwargs):
4241
"traceback.exc_type": Style(color=Color.RED, bgcolor=Color.LIGHT_YELLOW3, bold=True),
4342
"argparse.args": Style(color=Color.AQUAMARINE3, underline=True),
4443
}
45-
ru.set_theme(custom_theme)
44+
set_theme(custom_theme)
4645

4746
@cmd2.with_category("Theme Commands")
4847
def do_theme_show(self, _: cmd2.Statement):

0 commit comments

Comments
 (0)