def config_from_object(self, obj: Any, *, silent: bool = False, force: bool = False) -> None: """Read configuration from object. Object is either an actual object or the name of a module to import. Examples: >>> app.config_from_object('myproj.faustconfig') >>> from myproj import faustconfig >>> app.config_from_object(faustconfig) Arguments: silent (bool): If true then import errors will be ignored. force (bool): Force reading configuration immediately. By default the configuration will be read only when required. """ self._config_source = obj if self.finalized or self.configured: Settings._warn_already_configured() if force or self.configured: self._conf = None self._configure(silent=silent)
def _load_settings(self, *, silent: bool = False) -> Settings: changes: Mapping[str, Any] = {} appid, defaults = self._default_options if self._config_source: changes = self._load_settings_from_source(self._config_source, silent=silent) conf = {**defaults, **changes} return Settings(appid, **self._prepare_compat_settings(conf))