waft.configuration.config_file.config_reader module

class waft.configuration.config_file.config_reader.ConfigReader(config_file_path: Path | str | None = None, auto_create: bool | None = None)

Bases: ConfigBase

Class for reading configuration data.

get_group_by_name(name: str) UserConfiguredGroup | None

Retrieve a group by its name.

Parameters:

name (str) – The name of the group to retrieve.

Returns:

The UserConfiguredGroup instance if found, or None.

Return type:

Optional[UserConfiguredGroup]

get_group_names() List[str]

Retrieve a list of group names from the configuration.

Returns:

A list of group names.

Return type:

List[str]

get_groups() Dict[str, UserConfiguredGroup]

Retrieve a dictionary of groups from the configuration.

Returns:

A dictionary mapping group names to UserConfiguredGroup instances.

Return type:

Dict[str, UserConfiguredGroup]

get_json_data() dict

Retrieve the configuration data as a JSON object, with proxies as objects.

get_proxies() List[UserConfiguredProxy]

Retrieve proxy systems from the configuration.

Returns:

A list of configured proxy systems.

Return type:

List[UserConfiguredProxy]

get_proxy_by_name(name: str) UserConfiguredProxy | None

Retrieve a proxy system by its name.

Parameters:

name (str) – The name of the proxy system to retrieve.

Returns:

The proxy system object if found, or None if no matching proxy system exists.

Return type:

Optional[UserConfiguredProxy]

get_system_by_name(name: str) UserConfiguredSystem | UserConfiguredLocalSystem | None

Retrieve a system configuration by its name.

Parameters:

name (str) – The name of the system to retrieve.

Returns:

The system configuration object if found, or None if no matching system is found.

Return type:

Optional[UserConfiguredSystem | UserConfiguredLocalSystem]

Raises:

ValueError – If the proxy for the system is specified but not found in the proxy systems.

get_system_names() List[str]

Retrieve a list of system names from the configuration.

Returns:

A list of system names.

Return type:

List[str]

get_systems() List[UserConfiguredSystem]

Retrieve a list of systems without resolving proxy details.

Returns:

A list of UserConfiguredSystem instances.

Return type:

List[UserConfiguredSystem]

get_systems_from_group_or_system_name(name: str) List[UserConfiguredSystem]

Find systems by the name of a group or a system.

Parameters:

name (str) – The name of the group or system to retrieve.

Returns:

A list of UserConfiguredSystem instances.

Return type:

List[UserConfiguredSystem]

Raises:

ValueError – If the group or system with the specified name does not exist.