Mercurial > hg > configuration
comparison README.txt @ 68:1025d283a570
start in on the README
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 28 Mar 2012 10:27:17 -0700 |
parents | b7e7f450ad1a |
children | 451aeb35ec04 |
comparison
equal
deleted
inserted
replaced
67:c831eb58fb52 | 68:1025d283a570 |
---|---|
1 configuration | 1 configuration |
2 =========== | 2 =========== |
3 | 3 |
4 multi-level unified configuration for python consumption | 4 multi-level unified configuration for python consumption |
5 | 5 |
6 - you have a (python) program that wants to read configuration from | |
7 configuration files (I currently support JSON and YAML) and also | |
8 from the command line | |
9 - you want to be able to serialize and deserialize configuration | |
10 | |
6 API | 11 API |
7 --- | 12 --- |
8 | 13 |
9 TODO : document this | 14 The ``configuration.Configuration`` class implements an abstract base |
15 class that extends ``optparse.OptionParser``. The form of the | |
16 configuration is dictated by setting the ``options`` attribute on your | |
17 subclass. ``options`` is a dictionary of the form:: | |
18 | |
19 {'name': {<value>}} | |
20 | |
21 ``name`` is the name of the configuration option, and ``value`` is a | |
22 ``dict`` that gives the form of the option. | |
23 | |
24 | |
25 For an example, see | |
26 http://k0s.org/mozilla/hg/configuration/file/c831eb58fb52/tests/example.py#l7 | |
10 | 27 |
11 | 28 |
12 Configuration Files | 29 Configuration Files |
13 ------------------- | 30 ------------------- |
14 | 31 |