Added default to multi-bundle methods. Closes #15

master
Tom Wilson 6 years ago
parent 460b4b2e18
commit fec4fa6070

@ -186,7 +186,7 @@ class ConfigManager():
self.root_config[bundle_name] = bundle_source self.root_config[bundle_name] = bundle_source
return deepcopy(bundle_source) return deepcopy(bundle_source)
def validate_bundles(self, bundle_names): def validate_bundles(self, bundle_names=None):
""" """
Validate multiple config bundles at once, validating each one with the corresponding Validate multiple config bundles at once, validating each one with the corresponding
ConfigSpecification stored in the ConfigManager. See ``validate_bundle()``. ConfigSpecification stored in the ConfigManager. See ``validate_bundle()``.
@ -200,6 +200,8 @@ class ConfigManager():
dict: A dict of deepcopied config bundles, with keys matching those passed in dict: A dict of deepcopied config bundles, with keys matching those passed in
``bundle_names``. ``bundle_names``.
""" """
if bundle_names is None:
bundle_names = self.get_bundle_names()
config_values = {} config_values = {}
if isinstance(bundle_names, dict): if isinstance(bundle_names, dict):
@ -233,7 +235,7 @@ class ConfigManager():
return self.root_config[bundle_name] return self.root_config[bundle_name]
def get_config_bundles(self, bundle_names): def get_config_bundles(self, bundle_names=None):
""" """
Get multiple config bundles at once. If not yet validated, each will validate Get multiple config bundles at once. If not yet validated, each will validate
their config source against the corresponding config specification stored in the their config source against the corresponding config specification stored in the
@ -246,6 +248,8 @@ class ConfigManager():
dict: A dict of validated config bundles, with keys matching those passed in dict: A dict of validated config bundles, with keys matching those passed in
``bundle_names``. ``bundle_names``.
""" """
if bundle_names is None:
bundle_names = self.get_bundle_names()
config_values = {} config_values = {}
if isinstance(bundle_names, str): if isinstance(bundle_names, str):

Loading…
Cancel
Save