MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / _build_config_key

Method _build_config_key

cmd2/rich_utils.py:433–451  ·  view source on GitHub ↗

Build a key representing the settings used to initialize a console. This key includes the file identity, global settings (ALLOW_STYLE, application theme), and any other settings passed in via kwargs. :param file: file stream being checked :param kwargs: other consol

(
        *,
        file: IO[str] | None,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

431
432 @staticmethod
433 def _build_config_key(
434 *,
435 file: IO[str] | None,
436 **kwargs: Any,
437 ) -> tuple[Any, ...]:
438 """Build a key representing the settings used to initialize a console.
439
440 This key includes the file identity, global settings (ALLOW_STYLE, application theme),
441 and any other settings passed in via kwargs.
442
443 :param file: file stream being checked
444 :param kwargs: other console settings
445 """
446 return (
447 id(file),
448 ALLOW_STYLE,
449 id(get_theme()),
450 tuple(sorted(kwargs.items())),
451 )
452
453 def matches_config(
454 self,

Callers 2

__init__Method · 0.95
matches_configMethod · 0.95

Calls 1

get_themeFunction · 0.85

Tested by

no test coverage detected