5 | 5 |
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
|
6 | 6 |
<title>Reading and Writing Config Files</title>
|
7 | 7 |
<meta name="authors" content="Michael Foord Nicola Larosa" />
|
8 | |
<meta name="date" content="2008/02/24" />
|
|
8 |
<meta name="date" content="2008/06/27" />
|
9 | 9 |
<meta content="ConfigObj - a Python module for easy reading and writing of config files." name="description" />
|
10 | 10 |
<meta content="python, script, module, config, configuration, data, persistence, developer, configparser" name="keywords" />
|
11 | 11 |
<link rel="stylesheet" href="stylesheets/voidspace_docutils.css" type="text/css" />
|
|
22 | 22 |
<td>Michael Foord
|
23 | 23 |
<br />Nicola Larosa</td></tr>
|
24 | 24 |
<tr><th class="docinfo-name">Version:</th>
|
25 | |
<td>ConfigObj 4.5.2</td></tr>
|
|
25 |
<td>ConfigObj 4.5.3</td></tr>
|
26 | 26 |
<tr><th class="docinfo-name">Date:</th>
|
27 | |
<td>2008/02/24</td></tr>
|
|
27 |
<td>2008/06/27</td></tr>
|
28 | 28 |
<tr class="field"><th class="docinfo-name">Homepage:</th><td class="field-body"><a class="reference external" href="http://www.voidspace.org.uk/python/configobj.html">ConfigObj Homepage</a></td>
|
29 | 29 |
</tr>
|
30 | 30 |
<tr class="field"><th class="docinfo-name">Sourceforge:</th><td class="field-body"><a class="reference external" href="http://sourceforge.net/projects/configobj">Sourceforge</a></td>
|
|
124 | 124 |
<li><a class="reference internal" href="#todo" id="id89">18 TODO</a></li>
|
125 | 125 |
<li><a class="reference internal" href="#issues" id="id90">19 ISSUES</a></li>
|
126 | 126 |
<li><a class="reference internal" href="#changelog" id="id91">20 CHANGELOG</a><ul class="auto-toc">
|
127 | |
<li><a class="reference internal" href="#version-4-5-2" id="id92">20.1 2008/02/05 - Version 4.5.2</a></li>
|
128 | |
<li><a class="reference internal" href="#version-4-5-1" id="id93">20.2 2008/02/05 - Version 4.5.1</a></li>
|
129 | |
<li><a class="reference internal" href="#version-4-5-0" id="id94">20.3 2008/02/05 - Version 4.5.0</a></li>
|
130 | |
<li><a class="reference internal" href="#version-4-4-0" id="id95">20.4 2007/02/04 - Version 4.4.0</a></li>
|
131 | |
<li><a class="reference internal" href="#version-4-3-3-alpha4" id="id96">20.5 2006/12/17 - Version 4.3.3-alpha4</a></li>
|
132 | |
<li><a class="reference internal" href="#version-4-3-3-alpha3" id="id97">20.6 2006/12/17 - Version 4.3.3-alpha3</a></li>
|
133 | |
<li><a class="reference internal" href="#version-4-3-3-alpha2" id="id98">20.7 2006/12/09 - Version 4.3.3-alpha2</a></li>
|
134 | |
<li><a class="reference internal" href="#version-4-3-3-alpha1" id="id99">20.8 2006/12/09 - Version 4.3.3-alpha1</a></li>
|
135 | |
<li><a class="reference internal" href="#version-4-3-2" id="id100">20.9 2006/06/04 - Version 4.3.2</a></li>
|
136 | |
<li><a class="reference internal" href="#version-4-3-1" id="id101">20.10 2006/04/29 - Version 4.3.1</a></li>
|
137 | |
<li><a class="reference internal" href="#version-4-3-0" id="id102">20.11 2006/03/24 - Version 4.3.0</a></li>
|
138 | |
<li><a class="reference internal" href="#version-4-2-0" id="id103">20.12 2006/02/16 - Version 4.2.0</a></li>
|
139 | |
<li><a class="reference internal" href="#version-4-1-0" id="id104">20.13 2005/12/14 - Version 4.1.0</a></li>
|
140 | |
<li><a class="reference internal" href="#version-4-0-2" id="id105">20.14 2005/12/02 - Version 4.0.2</a></li>
|
141 | |
<li><a class="reference internal" href="#version-4-0-1" id="id106">20.15 2005/11/05 - Version 4.0.1</a></li>
|
142 | |
<li><a class="reference internal" href="#version-4-0-0" id="id107">20.16 2005/10/17 - Version 4.0.0</a></li>
|
143 | |
<li><a class="reference internal" href="#version-4-0-0-beta-5" id="id108">20.17 2005/09/09 - Version 4.0.0 beta 5</a></li>
|
144 | |
<li><a class="reference internal" href="#version-4-0-0-beta-4" id="id109">20.18 2005/09/07 - Version 4.0.0 beta 4</a></li>
|
145 | |
<li><a class="reference internal" href="#version-4-0-0-beta-3" id="id110">20.19 2005/08/28 - Version 4.0.0 beta 3</a></li>
|
146 | |
<li><a class="reference internal" href="#version-4-0-0-beta-2" id="id111">20.20 2005/08/25 - Version 4.0.0 beta 2</a></li>
|
147 | |
<li><a class="reference internal" href="#version-4-0-0-beta-1" id="id112">20.21 2005/08/21 - Version 4.0.0 beta 1</a></li>
|
148 | |
<li><a class="reference internal" href="#version-3-0-0" id="id113">20.22 2004/05/24 - Version 3.0.0</a></li>
|
149 | |
<li><a class="reference internal" href="#version-2-0-0-beta" id="id114">20.23 2004/03/14 - Version 2.0.0 beta</a></li>
|
150 | |
<li><a class="reference internal" href="#version-1-0-5" id="id115">20.24 2004/01/29 - Version 1.0.5</a></li>
|
151 | |
<li><a class="reference internal" href="#origins" id="id116">20.25 Origins</a></li>
|
152 | |
</ul>
|
153 | |
</li>
|
154 | |
<li><a class="reference internal" href="#footnotes" id="id117">21 Footnotes</a></li>
|
|
127 |
<li><a class="reference internal" href="#version-4-5-3" id="id92">20.1 2008/06/27 - Version 4.5.3</a></li>
|
|
128 |
<li><a class="reference internal" href="#version-4-5-2" id="id93">20.2 2008/02/05 - Version 4.5.2</a></li>
|
|
129 |
<li><a class="reference internal" href="#version-4-5-1" id="id94">20.3 2008/02/05 - Version 4.5.1</a></li>
|
|
130 |
<li><a class="reference internal" href="#version-4-5-0" id="id95">20.4 2008/02/05 - Version 4.5.0</a></li>
|
|
131 |
<li><a class="reference internal" href="#version-4-4-0" id="id96">20.5 2007/02/04 - Version 4.4.0</a></li>
|
|
132 |
<li><a class="reference internal" href="#version-4-3-3-alpha4" id="id97">20.6 2006/12/17 - Version 4.3.3-alpha4</a></li>
|
|
133 |
<li><a class="reference internal" href="#version-4-3-3-alpha3" id="id98">20.7 2006/12/17 - Version 4.3.3-alpha3</a></li>
|
|
134 |
<li><a class="reference internal" href="#version-4-3-3-alpha2" id="id99">20.8 2006/12/09 - Version 4.3.3-alpha2</a></li>
|
|
135 |
<li><a class="reference internal" href="#version-4-3-3-alpha1" id="id100">20.9 2006/12/09 - Version 4.3.3-alpha1</a></li>
|
|
136 |
<li><a class="reference internal" href="#version-4-3-2" id="id101">20.10 2006/06/04 - Version 4.3.2</a></li>
|
|
137 |
<li><a class="reference internal" href="#version-4-3-1" id="id102">20.11 2006/04/29 - Version 4.3.1</a></li>
|
|
138 |
<li><a class="reference internal" href="#version-4-3-0" id="id103">20.12 2006/03/24 - Version 4.3.0</a></li>
|
|
139 |
<li><a class="reference internal" href="#version-4-2-0" id="id104">20.13 2006/02/16 - Version 4.2.0</a></li>
|
|
140 |
<li><a class="reference internal" href="#version-4-1-0" id="id105">20.14 2005/12/14 - Version 4.1.0</a></li>
|
|
141 |
<li><a class="reference internal" href="#version-4-0-2" id="id106">20.15 2005/12/02 - Version 4.0.2</a></li>
|
|
142 |
<li><a class="reference internal" href="#version-4-0-1" id="id107">20.16 2005/11/05 - Version 4.0.1</a></li>
|
|
143 |
<li><a class="reference internal" href="#version-4-0-0" id="id108">20.17 2005/10/17 - Version 4.0.0</a></li>
|
|
144 |
<li><a class="reference internal" href="#version-4-0-0-beta-5" id="id109">20.18 2005/09/09 - Version 4.0.0 beta 5</a></li>
|
|
145 |
<li><a class="reference internal" href="#version-4-0-0-beta-4" id="id110">20.19 2005/09/07 - Version 4.0.0 beta 4</a></li>
|
|
146 |
<li><a class="reference internal" href="#version-4-0-0-beta-3" id="id111">20.20 2005/08/28 - Version 4.0.0 beta 3</a></li>
|
|
147 |
<li><a class="reference internal" href="#version-4-0-0-beta-2" id="id112">20.21 2005/08/25 - Version 4.0.0 beta 2</a></li>
|
|
148 |
<li><a class="reference internal" href="#version-4-0-0-beta-1" id="id113">20.22 2005/08/21 - Version 4.0.0 beta 1</a></li>
|
|
149 |
<li><a class="reference internal" href="#version-3-0-0" id="id114">20.23 2004/05/24 - Version 3.0.0</a></li>
|
|
150 |
<li><a class="reference internal" href="#version-2-0-0-beta" id="id115">20.24 2004/03/14 - Version 2.0.0 beta</a></li>
|
|
151 |
<li><a class="reference internal" href="#version-1-0-5" id="id116">20.25 2004/01/29 - Version 1.0.5</a></li>
|
|
152 |
<li><a class="reference internal" href="#origins" id="id117">20.26 Origins</a></li>
|
|
153 |
</ul>
|
|
154 |
</li>
|
|
155 |
<li><a class="reference internal" href="#footnotes" id="id118">21 Footnotes</a></li>
|
155 | 156 |
</ul>
|
156 | 157 |
</div>
|
157 | 158 |
<div class="section" id="introduction">
|
|
189 | 190 |
</div>
|
190 | 191 |
<div class="section" id="downloading">
|
191 | 192 |
<h1><a class="toc-backref" href="#id29">2 Downloading</a></h1>
|
192 | |
<p>The current version is <strong>4.5.2</strong>, dated 24th February 2008. ConfigObj 4 is
|
193 | |
now stable. We still expect to pick up a few bugs along the way though <a class="footnote-reference" href="#id16" id="id1">[1]</a>.
|
194 | |
<img src="smilies/smile.gif" alt="Smile" height="15" width="15" /> </p>
|
|
193 |
<p>The current version is <strong>4.5.3</strong>, dated 27th June 2008. ConfigObj 4 is
|
|
194 |
stable and mature. We still expect to pick up a few bugs along the way though <a class="footnote-reference" href="#id16" id="id1">[1]</a>.
|
|
195 |
<img src="/smilies/smile.gif" alt="Smile" height="15" width="15" /> </p>
|
195 | 196 |
<p>You can get ConfigObj in the following ways :</p>
|
196 | 197 |
<div class="section" id="files">
|
197 | 198 |
<h2><a class="toc-backref" href="#id30">2.1 Files</a></h2>
|
|
202 | 203 |
all the functionality except <a class="reference internal" href="#validation">Validation</a>.</p>
|
203 | 204 |
</blockquote>
|
204 | 205 |
</li>
|
205 | |
<li><p class="first"><a class="reference external" href="http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=configobj-4.5.2.zip">configobj.zip</a> from Voidspace</p>
|
|
206 |
<li><p class="first"><a class="reference external" href="http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=configobj-4.5.3.zip">configobj.zip</a> from Voidspace</p>
|
206 | 207 |
<blockquote>
|
207 | 208 |
<p>This also contains <a class="reference external" href="http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=validate.py">validate.py</a> and <a class="reference external" href="http://www.voidspace.org.uk/python/configobj.html">this document</a>.</p>
|
208 | 209 |
</blockquote>
|
|
1032 | 1033 |
<p>This is mainly to support 'legacy' config files, written from other
|
1033 | 1034 |
applications. This is documented under <a class="reference internal" href="#empty-values">Empty Values</a>.</p>
|
1034 | 1035 |
<p class="last"><a class="reference internal" href="#unrepr-mode">unrepr mode</a> introduces <em>another</em> syntax variation, used for storing
|
1035 | |
basic Python datatypes in config files. <img src="smilies/smile.gif" alt="Smile" height="15" width="15" /> </p>
|
|
1036 |
basic Python datatypes in config files. <img src="/smilies/smile.gif" alt="Smile" height="15" width="15" /> </p>
|
1036 | 1037 |
</div>
|
1037 | 1038 |
</div>
|
1038 | 1039 |
<div class="section" id="sections">
|
|
1234 | 1235 |
<li><p class="first"><strong>encode</strong></p>
|
1235 | 1236 |
<blockquote>
|
1236 | 1237 |
<p><tt class="docutils literal"><span class="pre">encode(encoding)</span></tt></p>
|
1237 | |
<p>This method is the opposite of <tt class="docutils literal"><span class="pre">decode</span></tt> <img src="smilies/exclaim.gif" alt="Exclamation" height="15" width="15" /> .</p>
|
|
1238 |
<p>This method is the opposite of <tt class="docutils literal"><span class="pre">decode</span></tt> <img src="/smilies/exclaim.gif" alt="Exclamation" height="15" width="15" /> .</p>
|
1238 | 1239 |
<p>It encodes names and values using the supplied encoding. If any of your
|
1239 | 1240 |
names/values are strings rather than Unicode, Python will have to do an
|
1240 | 1241 |
implicit decode first. (This method uses <tt class="docutils literal"><span class="pre">sys.defaultencoding</span></tt> for
|
|
1339 | 1340 |
They both define a function and pass it to walk. Because these functions
|
1340 | 1341 |
transform names as well as values (from byte strings to Unicode) they set
|
1341 | 1342 |
<tt class="docutils literal"><span class="pre">call_on_sections=True</span></tt>.</p>
|
1342 | |
<p>To see how they do it, <em>read the source Luke</em> <img src="smilies/cool.gif" alt="Cool" height="15" width="15" /> .</p>
|
|
1343 |
<p>To see how they do it, <em>read the source Luke</em> <img src="/smilies/cool.gif" alt="Cool" height="15" width="15" /> .</p>
|
1343 | 1344 |
<p>You can use this for transforming all values in your ConfigObj. For example
|
1344 | 1345 |
you might like the nested lists from ConfigObj 3. This was provided by the
|
1345 | 1346 |
<a class="reference external" href="http://www.voidspace.org.uk/python/modules.shtml#listquote">listquote</a> module. You could switch off the parsing for list values
|
|
1562 | 1563 |
<p class="last">One wrongly written line could break the basic structure of your config
|
1563 | 1564 |
file. This could cause every line after it to flag an error, so having a
|
1564 | 1565 |
list of all the lines that caused errors may not be as useful as it sounds.
|
1565 | |
<img src="smilies/sad.gif" alt="Sad" height="15" width="15" /> .</p>
|
|
1566 |
<img src="/smilies/sad.gif" alt="Sad" height="15" width="15" /> .</p>
|
1566 | 1567 |
</div>
|
1567 | 1568 |
</div>
|
1568 | 1569 |
<div class="section" id="validation">
|
|
1742 | 1743 |
<p>As a compromise - if the value is unchanged by validation then it is not reset.
|
1743 | 1744 |
This means strings that pass through validation unmodified will not be
|
1744 | 1745 |
overwritten. If validation changes type - the value has to be overwritten, and
|
1745 | |
any interpolation references are lost <img src="smilies/sad.gif" alt="Sad" height="15" width="15" /> .</p>
|
|
1746 |
any interpolation references are lost <img src="/smilies/sad.gif" alt="Sad" height="15" width="15" /> .</p>
|
1746 | 1747 |
</div>
|
1747 | 1748 |
<div class="section" id="simpleval">
|
1748 | 1749 |
<h2><a class="toc-backref" href="#id79">9.7 SimpleVal</a></h2>
|
|
1975 | 1976 |
very unrestrictive license, but it comes with the usual disclaimer. This is
|
1976 | 1977 |
free software: test it, break it, just don't blame us if it eats your data !
|
1977 | 1978 |
Of course if it does, let us know and we'll fix the problem so it doesn't
|
1978 | |
happen to anyone else <img src="smilies/smile.gif" alt="Smile" height="15" width="15" /> .</p>
|
|
1979 |
happen to anyone else <img src="/smilies/smile.gif" alt="Smile" height="15" width="15" /> .</p>
|
1979 | 1980 |
<pre class="literal-block">
|
1980 | 1981 |
Copyright (c) 2004 - 2008, Michael Foord & Nicola Larosa
|
1981 | 1982 |
All rights reserved.
|
|
2061 | 2062 |
<h1><a class="toc-backref" href="#id91">20 CHANGELOG</a></h1>
|
2062 | 2063 |
<p>This is an abbreviated changelog showing the major releases up to version 4.
|
2063 | 2064 |
From version 4 it lists all releases and changes.</p>
|
|
2065 |
<div class="section" id="version-4-5-3">
|
|
2066 |
<h2><a class="toc-backref" href="#id92">20.1 2008/06/27 - Version 4.5.3</a></h2>
|
|
2067 |
<p>BUGFIX: fixed a problem with <tt class="docutils literal"><span class="pre">copy=True</span></tt> when validating with configspecs that use
|
|
2068 |
<tt class="docutils literal"><span class="pre">__many__</span></tt> sections.</p>
|
|
2069 |
</div>
|
2064 | 2070 |
<div class="section" id="version-4-5-2">
|
2065 | |
<h2><a class="toc-backref" href="#id92">20.1 2008/02/05 - Version 4.5.2</a></h2>
|
|
2071 |
<h2><a class="toc-backref" href="#id93">20.2 2008/02/05 - Version 4.5.2</a></h2>
|
2066 | 2072 |
<p>Distribution updated to include version 0.3.2 of <a class="reference internal" href="#validate">validate</a>. This means that
|
2067 | 2073 |
<tt class="docutils literal"><span class="pre">None</span></tt> as a default value win configspecs works.</p>
|
2068 | 2074 |
</div>
|
2069 | 2075 |
<div class="section" id="version-4-5-1">
|
2070 | |
<h2><a class="toc-backref" href="#id93">20.2 2008/02/05 - Version 4.5.1</a></h2>
|
|
2076 |
<h2><a class="toc-backref" href="#id94">20.3 2008/02/05 - Version 4.5.1</a></h2>
|
2071 | 2077 |
<p>Distribution updated to include version 0.3.1 of <a class="reference internal" href="#validate">validate</a>. This means that
|
2072 | 2078 |
Unicode configspecs now work.</p>
|
2073 | 2079 |
</div>
|
2074 | 2080 |
<div class="section" id="version-4-5-0">
|
2075 | |
<h2><a class="toc-backref" href="#id94">20.3 2008/02/05 - Version 4.5.0</a></h2>
|
|
2081 |
<h2><a class="toc-backref" href="#id95">20.4 2008/02/05 - Version 4.5.0</a></h2>
|
2076 | 2082 |
<p>ConfigObj will now guarantee that files will be written terminated with a
|
2077 | 2083 |
newline.</p>
|
2078 | 2084 |
<p>ConfigObj will no longer attempt to import the <tt class="docutils literal"><span class="pre">validate</span></tt> module, until/unless
|
|
2096 | 2102 |
<p>Removed old CHANGELOG file.</p>
|
2097 | 2103 |
</div>
|
2098 | 2104 |
<div class="section" id="version-4-4-0">
|
2099 | |
<h2><a class="toc-backref" href="#id95">20.4 2007/02/04 - Version 4.4.0</a></h2>
|
|
2105 |
<h2><a class="toc-backref" href="#id96">20.5 2007/02/04 - Version 4.4.0</a></h2>
|
2100 | 2106 |
<p>Official release of 4.4.0</p>
|
2101 | 2107 |
</div>
|
2102 | 2108 |
<div class="section" id="version-4-3-3-alpha4">
|
2103 | |
<h2><a class="toc-backref" href="#id96">20.5 2006/12/17 - Version 4.3.3-alpha4</a></h2>
|
|
2109 |
<h2><a class="toc-backref" href="#id97">20.6 2006/12/17 - Version 4.3.3-alpha4</a></h2>
|
2104 | 2110 |
<p>By Nicola Larosa</p>
|
2105 | 2111 |
<p>Allowed arbitrary indentation in the <tt class="docutils literal"><span class="pre">indent_type</span></tt> parameter, removed the
|
2106 | 2112 |
<tt class="docutils literal"><span class="pre">NUM_INDENT_SPACES</span></tt> and <tt class="docutils literal"><span class="pre">MAX_INTERPOL_DEPTH</span></tt> (a leftover) constants,
|
|
2111 | 2117 |
with <a class="reference external" href="http://www.codeplex.com/IronPython">IronPython</a>.</p>
|
2112 | 2118 |
</div>
|
2113 | 2119 |
<div class="section" id="version-4-3-3-alpha3">
|
2114 | |
<h2><a class="toc-backref" href="#id97">20.6 2006/12/17 - Version 4.3.3-alpha3</a></h2>
|
|
2120 |
<h2><a class="toc-backref" href="#id98">20.7 2006/12/17 - Version 4.3.3-alpha3</a></h2>
|
2115 | 2121 |
<p>By Nicola Larosa</p>
|
2116 | 2122 |
<p>Added a missing <tt class="docutils literal"><span class="pre">self.</span></tt> in the _handle_comment method and a related test,
|
2117 | 2123 |
per Sourceforge bug #1523975.</p>
|
2118 | 2124 |
</div>
|
2119 | 2125 |
<div class="section" id="version-4-3-3-alpha2">
|
2120 | |
<h2><a class="toc-backref" href="#id98">20.7 2006/12/09 - Version 4.3.3-alpha2</a></h2>
|
|
2126 |
<h2><a class="toc-backref" href="#id99">20.8 2006/12/09 - Version 4.3.3-alpha2</a></h2>
|
2121 | 2127 |
<p>By Nicola Larosa</p>
|
2122 | 2128 |
<p>Changed interpolation search strategy, based on this patch by Robin Munn:
|
2123 | 2129 |
<a class="reference external" href="http://sourceforge.net/mailarchive/message.php?msg_id=17125993">http://sourceforge.net/mailarchive/message.php?msg_id=17125993</a></p>
|
2124 | 2130 |
</div>
|
2125 | 2131 |
<div class="section" id="version-4-3-3-alpha1">
|
2126 | |
<h2><a class="toc-backref" href="#id99">20.8 2006/12/09 - Version 4.3.3-alpha1</a></h2>
|
|
2132 |
<h2><a class="toc-backref" href="#id100">20.9 2006/12/09 - Version 4.3.3-alpha1</a></h2>
|
2127 | 2133 |
<p>By Nicola Larosa</p>
|
2128 | 2134 |
<p>Added Template-style interpolation, with tests, based on this patch by
|
2129 | 2135 |
Robin Munn: <a class="reference external" href="http://sourceforge.net/mailarchive/message.php?msg_id=17125991">http://sourceforge.net/mailarchive/message.php?msg_id=17125991</a>
|
2130 | 2136 |
(awful archives, bad Sourceforge, bad).</p>
|
2131 | 2137 |
</div>
|
2132 | 2138 |
<div class="section" id="version-4-3-2">
|
2133 | |
<h2><a class="toc-backref" href="#id100">20.9 2006/06/04 - Version 4.3.2</a></h2>
|
|
2139 |
<h2><a class="toc-backref" href="#id101">20.10 2006/06/04 - Version 4.3.2</a></h2>
|
2134 | 2140 |
<p>Changed error handling, if parsing finds a single error then that error will
|
2135 | 2141 |
be re-raised. That error will still have an <tt class="docutils literal"><span class="pre">errors</span></tt> and a <tt class="docutils literal"><span class="pre">config</span></tt>
|
2136 | 2142 |
attribute.</p>
|
|
2139 | 2145 |
Philippe Normand for the report.)</p>
|
2140 | 2146 |
<p>As a consequence of this fix, ConfigObj doesn't now keep inline comments in
|
2141 | 2147 |
<tt class="docutils literal"><span class="pre">unrepr</span></tt> mode. This is because the parser in the <a class="reference external" href="http://docs.python.org/lib/compiler.html">compiler package</a>
|
2142 | |
doesn't keep comments. <img src="smilies/smile.gif" alt="Smile" height="15" width="15" /> </p>
|
|
2148 |
doesn't keep comments. <img src="/smilies/smile.gif" alt="Smile" height="15" width="15" /> </p>
|
2143 | 2149 |
<p>Error messages are now more useful. They tell you the number of parsing errors
|
2144 | 2150 |
and the line number of the first error. (In the case of multiple errors.)</p>
|
2145 | 2151 |
<p>Line numbers in exceptions now start at 1, not 0.</p>
|
|
2147 | 2153 |
The errors stored will be an <tt class="docutils literal"><span class="pre">UnreprError</span></tt>.</p>
|
2148 | 2154 |
</div>
|
2149 | 2155 |
<div class="section" id="version-4-3-1">
|
2150 | |
<h2><a class="toc-backref" href="#id101">20.10 2006/04/29 - Version 4.3.1</a></h2>
|
|
2156 |
<h2><a class="toc-backref" href="#id102">20.11 2006/04/29 - Version 4.3.1</a></h2>
|
2151 | 2157 |
<p>Added <tt class="docutils literal"><span class="pre">validate.py</span></tt> back into <tt class="docutils literal"><span class="pre">configobj.zip</span></tt>. (Thanks to Stewart
|
2152 | 2158 |
Midwinter)</p>
|
2153 | 2159 |
<p>Updated to <a class="reference external" href="http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=validate.py">validate.py</a> 0.2.2.</p>
|
|
2159 | 2165 |
Dangoor.)</p>
|
2160 | 2166 |
</div>
|
2161 | 2167 |
<div class="section" id="version-4-3-0">
|
2162 | |
<h2><a class="toc-backref" href="#id102">20.11 2006/03/24 - Version 4.3.0</a></h2>
|
|
2168 |
<h2><a class="toc-backref" href="#id103">20.12 2006/03/24 - Version 4.3.0</a></h2>
|
2163 | 2169 |
<p>Moved the tests and the CHANGELOG (etc) into a separate file. This has reduced
|
2164 | 2170 |
the size of <tt class="docutils literal"><span class="pre">configobj.py</span></tt> by about 40%.</p>
|
2165 | 2171 |
<p>Added the <tt class="docutils literal"><span class="pre">unrepr</span></tt> mode to reading and writing config files. Thanks to Kevin
|
|
2181 | 2187 |
<p>Sorted footnotes in the docs.</p>
|
2182 | 2188 |
</div>
|
2183 | 2189 |
<div class="section" id="version-4-2-0">
|
2184 | |
<h2><a class="toc-backref" href="#id103">20.12 2006/02/16 - Version 4.2.0</a></h2>
|
|
2190 |
<h2><a class="toc-backref" href="#id104">20.13 2006/02/16 - Version 4.2.0</a></h2>
|
2185 | 2191 |
<p>Removed <tt class="docutils literal"><span class="pre">BOM_UTF8</span></tt> from <tt class="docutils literal"><span class="pre">__all__</span></tt>.</p>
|
2186 | 2192 |
<p>The <tt class="docutils literal"><span class="pre">BOM</span></tt> attribute has become a boolean. (Defaults to <tt class="docutils literal"><span class="pre">False</span></tt>.) It is
|
2187 | 2193 |
<em>only</em> <tt class="docutils literal"><span class="pre">True</span></tt> for the <tt class="docutils literal"><span class="pre">UTF16/UTF8</span></tt> encodings.</p>
|
|
2205 | 2211 |
<p>Added <tt class="docutils literal"><span class="pre">as_int</span></tt> and <tt class="docutils literal"><span class="pre">as_float</span></tt>.</p>
|
2206 | 2212 |
</div>
|
2207 | 2213 |
<div class="section" id="version-4-1-0">
|
2208 | |
<h2><a class="toc-backref" href="#id104">20.13 2005/12/14 - Version 4.1.0</a></h2>
|
|
2214 |
<h2><a class="toc-backref" href="#id105">20.14 2005/12/14 - Version 4.1.0</a></h2>
|
2209 | 2215 |
<p>Added <tt class="docutils literal"><span class="pre">merge</span></tt>, a recursive update.</p>
|
2210 | 2216 |
<p>Added <tt class="docutils literal"><span class="pre">preserve_errors</span></tt> to <tt class="docutils literal"><span class="pre">validate</span></tt> and the <tt class="docutils literal"><span class="pre">flatten_errors</span></tt>
|
2211 | 2217 |
example function.</p>
|
|
2217 | 2223 |
<p>Also use the new list syntax in <a class="reference internal" href="#validate">validate</a> 0.2.1. (For configspecs).</p>
|
2218 | 2224 |
</div>
|
2219 | 2225 |
<div class="section" id="version-4-0-2">
|
2220 | |
<h2><a class="toc-backref" href="#id105">20.14 2005/12/02 - Version 4.0.2</a></h2>
|
|
2226 |
<h2><a class="toc-backref" href="#id106">20.15 2005/12/02 - Version 4.0.2</a></h2>
|
2221 | 2227 |
<p>Fixed bug in <tt class="docutils literal"><span class="pre">create_empty</span></tt>. Thanks to Paul Jimenez for the report.</p>
|
2222 | 2228 |
</div>
|
2223 | 2229 |
<div class="section" id="version-4-0-1">
|
2224 | |
<h2><a class="toc-backref" href="#id106">20.15 2005/11/05 - Version 4.0.1</a></h2>
|
|
2230 |
<h2><a class="toc-backref" href="#id107">20.16 2005/11/05 - Version 4.0.1</a></h2>
|
2225 | 2231 |
<p>Fixed bug in <tt class="docutils literal"><span class="pre">Section.walk</span></tt> when transforming names as well as values.</p>
|
2226 | 2232 |
<p>Added the <tt class="docutils literal"><span class="pre">istrue</span></tt> method. (Fetches the boolean equivalent of a string
|
2227 | 2233 |
value).</p>
|
|
2230 | 2236 |
<p>List values are written as <tt class="docutils literal"><span class="pre">item,</span> <span class="pre">item</span></tt> rather than <tt class="docutils literal"><span class="pre">item,item</span></tt>.</p>
|
2231 | 2237 |
</div>
|
2232 | 2238 |
<div class="section" id="version-4-0-0">
|
2233 | |
<h2><a class="toc-backref" href="#id107">20.16 2005/10/17 - Version 4.0.0</a></h2>
|
|
2239 |
<h2><a class="toc-backref" href="#id108">20.17 2005/10/17 - Version 4.0.0</a></h2>
|
2234 | 2240 |
<p><strong>ConfigObj 4.0.0 Final</strong></p>
|
2235 | 2241 |
<p>Fixed bug in <tt class="docutils literal"><span class="pre">setdefault</span></tt>. When creating a new section with setdefault the
|
2236 | 2242 |
reference returned would be to the dictionary passed in <em>not</em> to the new
|
|
2238 | 2244 |
<p>Obscure typo/bug fixed in <tt class="docutils literal"><span class="pre">write</span></tt>. Wouldn't have affected anyone though.</p>
|
2239 | 2245 |
</div>
|
2240 | 2246 |
<div class="section" id="version-4-0-0-beta-5">
|
2241 | |
<h2><a class="toc-backref" href="#id108">20.17 2005/09/09 - Version 4.0.0 beta 5</a></h2>
|
|
2247 |
<h2><a class="toc-backref" href="#id109">20.18 2005/09/09 - Version 4.0.0 beta 5</a></h2>
|
2242 | 2248 |
<p>Removed <tt class="docutils literal"><span class="pre">PositionError</span></tt>.</p>
|
2243 | 2249 |
<p>Allowed quotes around keys as documented.</p>
|
2244 | 2250 |
<p>Fixed bug with commas in comments. (matched as a list value)</p>
|
2245 | 2251 |
</div>
|
2246 | 2252 |
<div class="section" id="version-4-0-0-beta-4">
|
2247 | |
<h2><a class="toc-backref" href="#id109">20.18 2005/09/07 - Version 4.0.0 beta 4</a></h2>
|
|
2253 |
<h2><a class="toc-backref" href="#id110">20.19 2005/09/07 - Version 4.0.0 beta 4</a></h2>
|
2248 | 2254 |
<p>Fixed bug in <tt class="docutils literal"><span class="pre">__delitem__</span></tt>. Deleting an item no longer deletes the
|
2249 | 2255 |
<tt class="docutils literal"><span class="pre">inline_comments</span></tt> attribute.</p>
|
2250 | 2256 |
<p>Fixed bug in initialising ConfigObj from a ConfigObj.</p>
|
2251 | 2257 |
<p>Changed the mailing list address.</p>
|
2252 | 2258 |
</div>
|
2253 | 2259 |
<div class="section" id="version-4-0-0-beta-3">
|
2254 | |
<h2><a class="toc-backref" href="#id110">20.19 2005/08/28 - Version 4.0.0 beta 3</a></h2>
|
|
2260 |
<h2><a class="toc-backref" href="#id111">20.20 2005/08/28 - Version 4.0.0 beta 3</a></h2>
|
2255 | 2261 |
<p>Interpolation is switched off before writing out files.</p>
|
2256 | 2262 |
<p>Fixed bug in handling <tt class="docutils literal"><span class="pre">StringIO</span></tt> instances. (Thanks to report from
|
2257 | 2263 |
Gustavo Niemeyer.)</p>
|
|
2259 | 2265 |
(For the sake of IDE calltips).</p>
|
2260 | 2266 |
</div>
|
2261 | 2267 |
<div class="section" id="version-4-0-0-beta-2">
|
2262 | |
<h2><a class="toc-backref" href="#id111">20.20 2005/08/25 - Version 4.0.0 beta 2</a></h2>
|
|
2268 |
<h2><a class="toc-backref" href="#id112">20.21 2005/08/25 - Version 4.0.0 beta 2</a></h2>
|
2263 | 2269 |
<p>Amendments to <em>validate.py</em>.</p>
|
2264 | 2270 |
<p>First public release.</p>
|
2265 | 2271 |
</div>
|
2266 | 2272 |
<div class="section" id="version-4-0-0-beta-1">
|
2267 | |
<h2><a class="toc-backref" href="#id112">20.21 2005/08/21 - Version 4.0.0 beta 1</a></h2>
|
|
2273 |
<h2><a class="toc-backref" href="#id113">20.22 2005/08/21 - Version 4.0.0 beta 1</a></h2>
|
2268 | 2274 |
<p>Reads nested subsections to any depth.</p>
|
2269 | 2275 |
<p>Multiline values.</p>
|
2270 | 2276 |
<p>Simplified options and methods.</p>
|
|
2279 | 2285 |
</ul>
|
2280 | 2286 |
</blockquote>
|
2281 | 2287 |
<p>Improved error handling.</p>
|
2282 | |
<p>Plus lots of other improvements. <img src="smilies/biggrin.gif" alt="Very Happy" height="15" width="15" /> </p>
|
|
2288 |
<p>Plus lots of other improvements. <img src="/smilies/biggrin.gif" alt="Very Happy" height="15" width="15" /> </p>
|
2283 | 2289 |
</div>
|
2284 | 2290 |
<div class="section" id="version-3-0-0">
|
2285 | |
<h2><a class="toc-backref" href="#id113">20.22 2004/05/24 - Version 3.0.0</a></h2>
|
|
2291 |
<h2><a class="toc-backref" href="#id114">20.23 2004/05/24 - Version 3.0.0</a></h2>
|
2286 | 2292 |
<p>Several incompatible changes: another major overhaul and change. (Lots of
|
2287 | 2293 |
improvements though).</p>
|
2288 | 2294 |
<p>Added support for standard config files with sections. This has an entirely
|
|
2313 | 2319 |
<p>Charmap is now incorporated into ConfigObj.</p>
|
2314 | 2320 |
</div>
|
2315 | 2321 |
<div class="section" id="version-2-0-0-beta">
|
2316 | |
<h2><a class="toc-backref" href="#id114">20.23 2004/03/14 - Version 2.0.0 beta</a></h2>
|
|
2322 |
<h2><a class="toc-backref" href="#id115">20.24 2004/03/14 - Version 2.0.0 beta</a></h2>
|
2317 | 2323 |
<p>Re-written it to subclass dict. My first forays into inheritance and operator
|
2318 | 2324 |
overloading.</p>
|
2319 | 2325 |
<p>The config object now behaves like a dictionary.</p>
|
2320 | 2326 |
<p>I've completely broken the interface, but I don't think anyone was really
|
2321 | 2327 |
using it anyway.</p>
|
2322 | |
<p>This new version is much more 'classy'. <img src="smilies/wink.gif" alt="Wink" height="15" width="15" /> </p>
|
|
2328 |
<p>This new version is much more 'classy'. <img src="/smilies/wink.gif" alt="Wink" height="15" width="15" /> </p>
|
2323 | 2329 |
<p>It will also read straight from/to a filename and completely parse a config
|
2324 | 2330 |
file without you <em>having</em> to supply a config spec.</p>
|
2325 | 2331 |
<p>Uses listparse, so can handle nested list items as values.</p>
|
|
2327 | 2333 |
and delete.</p>
|
2328 | 2334 |
</div>
|
2329 | 2335 |
<div class="section" id="version-1-0-5">
|
2330 | |
<h2><a class="toc-backref" href="#id115">20.24 2004/01/29 - Version 1.0.5</a></h2>
|
|
2336 |
<h2><a class="toc-backref" href="#id116">20.25 2004/01/29 - Version 1.0.5</a></h2>
|
2331 | 2337 |
<p>Version 1.0.5 has a couple of bugfixes as well as a couple of useful additions
|
2332 | 2338 |
over previous versions.</p>
|
2333 | 2339 |
<p>Since 1.0.0 the buildconfig function has been moved into this distribution,
|
|
2335 | 2341 |
<p>A couple of bugs have been fixed.</p>
|
2336 | 2342 |
</div>
|
2337 | 2343 |
<div class="section" id="origins">
|
2338 | |
<h2><a class="toc-backref" href="#id116">20.25 Origins</a></h2>
|
|
2344 |
<h2><a class="toc-backref" href="#id117">20.26 Origins</a></h2>
|
2339 | 2345 |
<p>ConfigObj originated in a set of functions for reading config files in the
|
2340 | 2346 |
<a class="reference external" href="http://www.voidspace.org.uk/atlantibots/">atlantibots</a> project. The original
|
2341 | 2347 |
functions were written by Rob McNeur.</p>
|
|
2343 | 2349 |
</div>
|
2344 | 2350 |
<hr class="docutils" />
|
2345 | 2351 |
<div class="section" id="footnotes">
|
2346 | |
<h1><a class="toc-backref" href="#id117">21 Footnotes</a></h1>
|
|
2352 |
<h1><a class="toc-backref" href="#id118">21 Footnotes</a></h1>
|
2347 | 2353 |
<table class="docutils footnote" frame="void" id="id16" rules="none">
|
2348 | 2354 |
<colgroup><col class="label" /><col /></colgroup>
|
2349 | 2355 |
<tbody valign="top">
|
|
2464 | 2470 |
<div class="footer">
|
2465 | 2471 |
<hr class="footer" />
|
2466 | 2472 |
<a class="reference external" href="configobj.txt">View document source</a>.
|
2467 | |
Generated on: 2008-02-24 20:24 UTC.
|
|
2473 |
Generated on: 2008-06-28 12:01 UTC.
|
2468 | 2474 |
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
|
2469 | 2475 |
|
2470 | 2476 |
</div>
|