@@ -160,16 +160,16 @@ def __init__(
160160 "Passing 'theme' is not allowed. Its behavior is controlled by the global APP_THEME and set_theme()."
161161 )
162162
163- # Store the configuration used to create this console for caching purposes .
164- self ._config_key = self ._generate_config_key (file = file , ** kwargs )
163+ # Store the configuration key used by cmd2 to cache this console.
164+ self ._config_key = self ._build_config_key (file = file , ** kwargs )
165165
166166 force_terminal : bool | None = None
167167 force_interactive : bool | None = None
168168
169169 if ALLOW_STYLE == AllowStyle .ALWAYS :
170170 force_terminal = True
171171
172- # Turn off interactive mode if dest is not actually a terminal which supports it
172+ # Turn off interactive mode if dest is not a terminal which supports it.
173173 tmp_console = Console (file = file )
174174 force_interactive = tmp_console .is_interactive
175175 elif ALLOW_STYLE == AllowStyle .NEVER :
@@ -184,12 +184,12 @@ def __init__(
184184 )
185185
186186 @staticmethod
187- def _generate_config_key (
187+ def _build_config_key (
188188 * ,
189189 file : IO [str ] | None ,
190190 ** kwargs : Any ,
191191 ) -> tuple [Any , ...]:
192- """Generate a key representing the settings used to initialize a console.
192+ """Build a key representing the settings used to initialize a console.
193193
194194 This key includes the file identity, global settings (ALLOW_STYLE, APP_THEME),
195195 and any other settings passed in via kwargs.
@@ -216,7 +216,7 @@ def matches_config(
216216 :param kwargs: other console settings being checked
217217 :return: True if the settings match this console's configuration
218218 """
219- return self ._config_key == self ._generate_config_key (file = file , ** kwargs )
219+ return self ._config_key == self ._build_config_key (file = file , ** kwargs )
220220
221221 def on_broken_pipe (self ) -> None :
222222 """Override which raises BrokenPipeError instead of SystemExit."""
0 commit comments