hololinked.config.Configuration
Allows to auto apply common settings used throughout the package, instead of passing these settings as arguments.
Import global_config variable instead of instantiating this class. Please check global_config docstring for supported values
or website documentation.
This implementation needs to be improved in general. Consider opening an issue if you have suggestions at GitHub.
Source code in repo/hololinked/hololinked/config.py
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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
Attributes
TEMP_DIR_SECRETS
property
Returns the temporary directory path for secret files.
TEMP_DIR_SOCKETS
property
Returns the temporary directory path for IPC sockets.
Functions
asdict
Returns this config as a regular dictionary.
Returns:
| Type | Description |
|---|---|
dict
|
the configuration values keyed by their names |
cleanup_temp_dirs
Cleans up temporary directories used by hololinked, all log files and IPC sockets are removed.
If cleanup_databases is True, database files are also removed.
Source code in repo/hololinked/hololinked/config.py
copy
Returns a copy of this config as another object.
Returns:
| Type | Description |
|---|---|
Configuration
|
a copy of this configuration |
Source code in repo/hololinked/hololinked/config.py
load_variables
Set default values. This method is called during __init__.
Source code in repo/hololinked/hololinked/config.py
set
Sets multiple config values at once, and recreates necessary global states.
load_variables sets default values first, then overwrites with environment file values.
This method only overwrites the specified values.
Source code in repo/hololinked/hololinked/config.py
set_db_folder
set_default_eventloop_settings
set_default_eventloop_settings(invokation_timeout: int | None = None, execution_timeout: int | None = None, oneway: bool = False) -> None
Sets the default eventloop and scheduler settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int | None
|
seconds to wait for an operation to start, 5 when not given |
None
|
|
int | None
|
seconds to wait for an operation to finish, 5 when not given |
None
|
|
bool
|
whether callers should expect no reply by default |
False
|
Source code in repo/hololinked/hololinked/config.py
set_logs_folder
set_secrets_folder
set_sockets_folders
set_temp_dir
Sets the base directory path for temporary files and application data (sockets, logs, databases, secrets).
setup
Actions to be done to recreate global configuration state after changing config values.
Called after load_variables and set methods.
Please call this method after changing config values directly specific to logging or event loop policy
Source code in repo/hololinked/hololinked/config.py
setup_temp_dirs
Create every temporary directory the package writes to, if missing.
Source code in repo/hololinked/hololinked/config.py
zmq_context
Returns the global ZMQ async context, creating it on first call.
Returns:
| Type | Description |
|---|---|
Context
|
the process-wide ZMQ async context |
Raises:
| Type | Description |
|---|---|
ImportError
|
if |