Commit 13890080 authored by Éric Araujo's avatar Éric Araujo

Make example of file inclusion in setupcfg more obvious

parent ed4fd704
...@@ -77,38 +77,37 @@ or more files which will be merged into the current files by adding new sections ...@@ -77,38 +77,37 @@ or more files which will be merged into the current files by adding new sections
and fields. If a file loaded by ``extends`` contains sections or keys that and fields. If a file loaded by ``extends`` contains sections or keys that
already exist in the original file, they will not override the previous values. already exist in the original file, they will not override the previous values.
Contents of :file:`one.cfg`::
file_one.ini::
[section1] [section1]
name2 = "other value" name = value
[section2] [section2]
foo = baz foo = foo from one.cfg
bas = bar
file_two.ini:: Contents of :file:`two.cfg`::
[DEFAULT] [DEFAULT]
extends = file_one.ini extends = one.cfg
[section2] [section2]
foo = bar foo = foo from two.cfg
baz = baz from two.cfg
Result:: The result of parsing :file:`two.cfg` is equivalent to this file::
[section1] [section1]
name2 = "other value" name = value
[section2] [section2]
foo = bar foo = foo from one.cfg
bas = bar baz = baz from two.cfg
To point several files, the multi-line notation can be used:: Example use of multi-line notation to include more than one file::
[DEFAULT] [DEFAULT]
extends = file_one.ini extends = one.cfg
file_two.ini two.cfg
When several files are provided, they are processed sequentially, following the When several files are provided, they are processed sequentially, following the
precedence rules explained above. This means that the list of files should go precedence rules explained above. This means that the list of files should go
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment