Add a new set of defaults to the configuration It does two things: 1. Add the defaults to a global collection to be used by refresh later 2. Updates the global config with the new configuration. Old values are prioritized over new ones, unless the current value is the
(
new: Mapping, config: dict = config, defaults: list[Mapping] = defaults
)
| 643 | |
| 644 | |
| 645 | def update_defaults( |
| 646 | new: Mapping, config: dict = config, defaults: list[Mapping] = defaults |
| 647 | ) -> None: |
| 648 | """Add a new set of defaults to the configuration |
| 649 | |
| 650 | It does two things: |
| 651 | |
| 652 | 1. Add the defaults to a global collection to be used by refresh later |
| 653 | 2. Updates the global config with the new configuration. |
| 654 | Old values are prioritized over new ones, unless the current value |
| 655 | is the old default, in which case it's updated to the new default. |
| 656 | """ |
| 657 | current_defaults = merge(*defaults) |
| 658 | defaults.append(new) |
| 659 | update(config, new, priority="new-defaults", defaults=current_defaults) |
| 660 | |
| 661 | |
| 662 | def expand_environment_variables(config: Any) -> Any: |