/usr/lib/python2.7/dist-packages/ConfArgParse-1.1.20.egg-info/PKG-INFO is in python-confargparse 1.1.20-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | Metadata-Version: 1.1
Name: ConfArgParse
Version: 1.1.20
Summary: An integrated argument/configuration file parser that follows the syntax of argparser
Home-page: https://bitbucket.org/swamidass/confargparse/
Author: S. Joshua Swamidass
Author-email: swamidass@gmail.com
License: UNKNOWN
Description:
============
ConfArgParse
============
This module adds a config file parsing capability to argparse.
Usage
-----
Start by importing the module and initializing the parser::
import confargparse
parser = confargparse.ConfArgParser()
The usage is identical to the argparse module::
parser.add_argument("-n", type=int)
group = parser.add_argument_group("my group")
group.add_argument("-g")
Now, to use a configuration file (or list of sequentially read configuration
files), just add the --conf-file option.
python prog.py --conf-file conf.ini
It is easy to write out a configuration file by applying all the options you
want, and then adding the --export-conf-file option.
python prog.py -n --export-conf-file > conf.ini
API Changes
-----------
All argparse code should be compatible by just drapping in the new object. This
package adds a few important options to the API to figure out how to map
namespace dests to configuration sections/names.
The key concepts to note:
1. Parameters in configuration files map to specific section/name pairs.
2. Configuration file sections and names ignore case.
Specifiying the Name
====================
By default all configuration names are the lowercase dest from argparse. Care
must be taken to make sure that there are no name clashes from dests with
different capitalizations.
The default name can be changed by using the "name" keyword to add_argument::
parser.add_argument("-n", type=int, name="my_n")
This targets the argument to "my_n" instead of "n" in the configuration file.
Specifying the Section
======================
By default, all configurations go to the [defaults] section. Argument
groups and subparsers inherit from the parser that initialized them.
The add_argument_group, add_argument, add_subparsers, and ConfArgParser
initialization all include the "section" optional keyword argument. Specifying
this section sets the section in the configuration the option will be targeted
to. If the value is None, the object will inherit up as expected::
parser = ConfArgParser(section = "main")
parser.add_argument("-n", type=int)
group = parser.add_argument_group("my group", section="group")
group.add_argument("-g")
group.add_argument("-t", section="section2")
In this example, the first argument targets to "n" name in the [main] section.
The second argument targets to the "g" name in the [group] section. The third
argument targets to the "t" name in the [section2] section.
Excluding Arguments
===================
Currently, positional arguments cannot be sent to the configuration file.
If you would like to exclude additional arguments, just use the exclude keyword
argument to add_arguments::
parser.add_argument("-n", type=int, exclude=True)
Suggestions or BugFixes?
========================
Feel free to contact me. I am findable online with a google search:
S. Joshua Swamidass.
Please send bug fixes as pull requests to the bitbucket repository
(`https://bitbucket.org/swamidass/confargparse
<https://bitbucket.org/swamidass/confargparse>`_). Please keep pull
requests clean, so I can easily figure out if it should be
merged into the main line.
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: Free for non-commercial use
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Intended Audience :: Developers
|