Config management
This class is accessed via the config
property on a CamillaClient
instance.
It provides methods for managing the configuration.
class: Config
Bases: _CommandGroup
Collection of methods for configuration management
Source code in camilladsp\config.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
active()
Get the active configuration as a Python object.
Returns:
Type | Description |
---|---|
Optional[Dict]
|
Dict | None: Current config as a Python dict, or None. |
Source code in camilladsp\config.py
77 78 79 80 81 82 83 84 85 86 87 88 |
|
active_json()
Get the active configuration in raw json format (as a string).
Returns:
Type | Description |
---|---|
Optional[str]
|
str | None: Current config as a raw json string, or None. |
Source code in camilladsp\config.py
58 59 60 61 62 63 64 65 66 |
|
active_raw()
Get the active configuration in raw yaml format (as a string).
Returns:
Type | Description |
---|---|
Optional[str]
|
str | None: Current config as a raw yaml string, or None. |
Source code in camilladsp\config.py
39 40 41 42 43 44 45 46 47 |
|
description()
Get the title of the active configuration.
Returns:
Type | Description |
---|---|
Optional[str]
|
str | None: Config description if defined, else None. |
Source code in camilladsp\config.py
167 168 169 170 171 172 173 174 175 |
|
file_path()
Get path to current config file.
Returns:
Type | Description |
---|---|
Optional[str]
|
str | None: Path to config file, or None. |
Source code in camilladsp\config.py
19 20 21 22 23 24 25 26 27 |
|
parse_yaml(config_string)
Parse a config from yaml string and return the contents as a Python object, with defaults filled out with their default values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_string |
str
|
A config as raw yaml string. |
required |
Returns:
Type | Description |
---|---|
Dict
|
Dict | None: Parsed config as a Python dict. |
Source code in camilladsp\config.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
previous()
Get the previously active configuration as a Python object.
Returns:
Type | Description |
---|---|
Optional[Dict]
|
Dict | None: Previous config as a Python dict, or None. |
Source code in camilladsp\config.py
90 91 92 93 94 95 96 97 98 99 |
|
read_and_parse_file(filename)
Read and parse a config file from disk and return the contents as a Python object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
Path to a config file. |
required |
Returns:
Type | Description |
---|---|
Dict
|
Dict | None: Parsed config as a Python dict. |
Source code in camilladsp\config.py
116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
set_active(config_object)
Upload and apply a new configuration from a Python object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_object |
Dict
|
A configuration as a Python dict. |
required |
Source code in camilladsp\config.py
130 131 132 133 134 135 136 137 138 |
|
set_active_json(config_string)
Upload and apply a new configuration in raw json format (as a string).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_string |
str
|
Config as json string. |
required |
Source code in camilladsp\config.py
68 69 70 71 72 73 74 75 |
|
set_active_raw(config_string)
Upload and apply a new configuration in raw yaml format (as a string).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_string |
str
|
Config as yaml string. |
required |
Source code in camilladsp\config.py
49 50 51 52 53 54 55 56 |
|
set_file_path(value)
Set path to config file, without loading it.
Call reload()
to apply the new config file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
str
|
Path to config file. |
required |
Source code in camilladsp\config.py
29 30 31 32 33 34 35 36 37 |
|
title()
Get the title of the active configuration.
Returns:
Type | Description |
---|---|
Optional[str]
|
str | None: Config title if defined, else None. |
Source code in camilladsp\config.py
157 158 159 160 161 162 163 164 165 |
|
validate(config_object)
Validate a configuration object. Returns the validated config with all optional fields filled with defaults. Raises a CamillaError on errors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_object |
Dict
|
A configuration as a Python dict. |
required |
Returns:
Type | Description |
---|---|
Dict
|
Dict | None: Validated config as a Python dict. |
Source code in camilladsp\config.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|