cars_mesh.config
Main configuration module of cars-mesh tool.
Module Contents
Functions
|
Check general items in configuration |
|
Check state machine parameters in configuration |
|
If path is a valid relative path with respect to directory, |
|
Read and check if the config path is valid and readable |
|
Global read and check if the config is readable (read_config), |
|
Save a json configuration file |
- cars_mesh.config.check_general_items(cfg: dict) dict [source]
Check general items in configuration
- Parameters:
cfg (dict) – Configuration dictionary
- Returns:
cfg – Configuration dictionary updated
- Return type:
dict
- cars_mesh.config.check_state_machine(cfg: dict) dict [source]
Check state machine parameters in configuration
- Parameters:
cfg (dict) – Configuration dictionary
- Returns:
cfg – Configuration dictionary updated
- Return type:
dict
- cars_mesh.config.make_relative_path_absolute(path, directory)[source]
If path is a valid relative path with respect to directory, returns it as an absolute path
- Parameters:
path (string) – The relative path
directory (string) – The directory path should be relative to
- Returns:
os.path.join(directory,path) if path is a valid relative path form directory, else path
- Return type:
string
- cars_mesh.config.read_config(cfg_path: str) dict [source]
Read and check if the config path is valid and readable and returns cfg if valid
- Parameters:
cfg_path (str) – Path to the JSON configuration file
- Returns:
cfg – Configuration dictionary
- Return type:
dict
- cars_mesh.config.check_config(cfg_path: str) dict [source]
Global read and check if the config is readable (read_config), with valid contents (check_general_items) and valid state machine (check_state_machine)
and returns read cfg at the end if valid
- Parameters:
cfg_path (str) – Path to the JSON configuration file
- Returns:
cfg – Configuration dictionary
- Return type:
dict