improve the documentation for option location information
Fix an error in the example code by setting loc to the Location enum value instead of the LocationInfo tuple. Add a cross-reference from the ConfigOpts get_location() method to the more extensive reference documentation about option locations. Change-Id: Ic9850afd78a7b42f4e807b04e78729a674942e15 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
c8a8f4eba1
commit
1319cfb476
@ -58,7 +58,7 @@ user-controlled separately.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
loc = CONF.get_location('normal_opt')
|
||||
loc = CONF.get_location('normal_opt').location
|
||||
if loc.is_user_controlled:
|
||||
print('normal_opt was set by the user')
|
||||
else:
|
||||
|
@ -3383,6 +3383,10 @@ class ConfigOpts(collections.Mapping):
|
||||
:type group: str
|
||||
:return: LocationInfo
|
||||
|
||||
.. seealso::
|
||||
|
||||
:doc:`/reference/locations`
|
||||
|
||||
.. versionadded:: 5.3.0
|
||||
"""
|
||||
value, loc = self._do_get(name, group, None)
|
||||
|
Loading…
Reference in New Issue
Block a user