Skip to content

This is a temporary port of configglue to latest Python 3 supported versions

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.PSF
Notifications You must be signed in to change notification settings

nessita/configglue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConfigGlue

tests

configglue -- glue for your apps' configuration

Three things:

AttributedConfigParser:

a ConfigParser that gives you attributed options. So a config file with

[foo]
bar = Hello World
bar.level = newbie

will have one option under the 'foo' section, and that option will have a value ('Hello World') and an attribute 'level', with value 'newbie'.

TypedConfigParser:

an AttributedConfigParser that uses the 'parser' attribtue to parse the value. So

[foo]
bar = 7
bar.parser = int

will have a 'foo' section with a 'bar' option which value is int('7').

configglue:

A function that creates an TypedConfigParser and uses it to build an optparse.OptionParser instance. So you can have a config file with

[foo]
bar.default = 7
bar.help = The bar number [%(default)s]
bar.metavar = BAR
bar.parser = int

and if you load it with configglue, you get something like

$ python sample.py --help
Usage: sample.py [options]

Options:
  -h, --help        show this help message and exit

  blah:
    --foo-bar=BAR   The bar number [7]

About

This is a temporary port of configglue to latest Python 3 supported versions

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.PSF

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages