Skip to content

dcspy

Modules:

Name Description
aircraft
dcsbios
log
logitech
migration
models
qt_gui
run
sdk
starter
utils

Functions:

Name Description
get_config_yaml_item

Get item from a configuration YAML file.

get_config_yaml_item

get_config_yaml_item(
    key: str, /, default: ConfigValue | None = None
) -> ConfigValue

Get item from a configuration YAML file.

Parameters:

Name Type Description Default

key

str

Key to get

required

default

ConfigValue | None

Default value if key not found

None

Returns:

Type Description
ConfigValue

Value from configuration

Source code in src/dcspy/__init__.py
32
33
34
35
36
37
38
39
40
def get_config_yaml_item(key: str, /, default: ConfigValue | None = None) -> ConfigValue:
    """
    Get item from a configuration YAML file.

    :param key: Key to get
    :param default: Default value if key not found
    :return: Value from configuration
    """
    return load_yaml(full_path=default_yaml).get(key, default) # type: ignore[return-value]