MCPcopy
hub / github.com/tox-dev/tox / get

Method get

src/tox/config/cli/ini.py:48–61  ·  view source on GitHub ↗
(self, key: str, of_type: type[Any])

Source from the content-addressed store, hash-verified

46 self.ini = IniLoader(CORE, parser, overrides=[], core_section=CORE)
47
48 def get(self, key: str, of_type: type[Any]) -> Any:
49 cache_key = key, of_type
50 if cache_key in self._cache:
51 result = self._cache[cache_key]
52 else:
53 try:
54 result = self._load_key(key, of_type)
55 except KeyError: # just not found
56 result = None
57 except Exception as exception: # noqa: BLE001
58 logging.warning("%s key %s as type %r failed with %r", self.config_file, key, of_type, exception)
59 result = None
60 self._cache[cache_key] = result
61 return result
62
63 def _load_key(self, key: str, of_type: type[Any]) -> Any:
64 if self.ini is None: # pragma: no cover # this can only happen if we don't call __bool__ first

Callers 15

__init__Method · 0.80
disable_pip_pypi_accessFunction · 0.80
compareMethod · 0.80
environment_variablesMethod · 0.80
_make_pathMethod · 0.80
resolve_extras_staticFunction · 0.80
resolveFunction · 0.80
_parse_script_metadataFunction · 0.80
child_pkg_envsMethod · 0.80

Calls 1

_load_keyMethod · 0.95