Skip to content
Myr

document return value for config loading methods

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Karuna Tata · committed by David Lord · parent a0afb6f · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:src/flask/config.py+5 added-1 removed
81 unmodified lines
8283 :param variable_name: name of the environment variable84 :param silent: set to ``True`` if you want silent failure for missing85 files.86 :return: bool. ``True`` if able to load config, ``False`` otherwise.86 :return: ``True`` if the file was loaded successfully.87 """88 rv = os.environ.get(variable_name)89 if not rv:90 if silent:
15 unmodified lines
106 absolute filename or a filename relative to the107 root path.108 :param silent: set to ``True`` if you want silent failure for missing109 files.110 :return: ``True`` if the file was loaded successfully.111112 .. versionadded:: 0.7113 `silent` parameter.114 """
70 unmodified lines
185 mapping of loaded data from the file.186 :type load: ``Callable[[Reader], Mapping]`` where ``Reader``187 implements a ``read`` method.188 :param silent: Ignore the file if it doesn't exist.189 :return: ``True`` if the file was loaded successfully.190191 .. versionadded:: 2.0192 """193 filename = os.path.join(self.root_path, filename)
16 unmodified lines
210211 :param filename: The path to the JSON file. This can be an212 absolute path or relative to the config root path.213 :param silent: Ignore the file if it doesn't exist.214 :return: ``True`` if the file was loaded successfully.215216 .. deprecated:: 2.0.0217 Will be removed in Flask 2.1. Use :meth:`from_file` instead.218 This was removed early in 2.0.0, was added back in 2.0.1.
15 unmodified lines
234 self, mapping: t.Optional[t.Mapping[str, t.Any]] = None, **kwargs: t.Any235 ) -> bool:236 """Updates the config like :meth:`update` ignoring items with non-upper237 keys.238 :return: Always returns ``True``.239240 .. versionadded:: 0.11241 """242 mappings: t.Dict[str, t.Any] = {}
53 unmodified lines