* Major refactor of configuration to remember parsers and contexts.
* Add new methods for modifying configuration and what a parser is for.
* Add a load_only parameter to make life easier.
* Rename variable on baseparser for ensuring no collisions occur by mistake
* Add a configuration command that *mostly* does what it should
[skip ci] because it'll fail anyway. The tests need updating.
This refactor is intended to make it easier to make configuration related improvements in the future, since all the code is in a separated unit.
The unit tests have been updated partially to merely update them. They now patch underscore names which means that they probably need updating.
* add site_config_dirs() to appdirs to determine locations across OSes
* add system_config_files to locations.py
* add system_config_files to get_config_files() and re-order files entries to correct precedence
* document changes to configuration files in user guide
Closes#309
Using sys.exc_info()[1] is a hack that was used to use a shared
source approach to Python 3.x support that also included versions
of Python that didn't include the except ... as exc: construction.
Pip no longer supports any of these versions of Python so we can
remove it.
2) have `create_main_parser` mark the parser as the 'main' parser.
3) remove an extraneus block that's never called. thanks @netspyer.
4) move 'create_main_parser` to __init__ to avoid circular or embedded imports.
Previously, we used `convert_value' in all cases, which seems
to try to detect lists based on the value of nargs, but that fails
with lists of one item. This "worked" for 'str' options, because
the values don't get checked, but was failing for choice types
(see Issue #772), and would fail for other types like int.
Add a new base parser class 'CustomOptionParser' that provides the
'insert_option_group(idx, *, **)' method for inserting an option group
at a specific position.