def __call__(self, parser, namespace, values, option_string=None): settings = {} for value in values: match = self.pattern.search(value) if not match: raise ValueError(value) k, v = match.group('k'), match.group('v') settings[k] = v settings = make_app_settings(settings) setattr(namespace, self.dest, settings)
def make_settings(self, settings_file, settings): if settings_file: return make_app_settings(settings_file, extra=settings) return make_app_settings(settings)
def __call__(self, parser, namespace, value, option_string=None): settings = make_app_settings(value) setattr(namespace, self.dest, settings)