/[py-configparser]/public_html/api-docs.shtml
ViewVC logotype

Contents of /public_html/api-docs.shtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 41 - (show annotations)
Tue Jun 10 20:50:45 2008 UTC (5 years, 10 months ago) by ehuelsmann
File size: 7538 byte(s)
Another XHTML compliance fix.
1 <?xml version="1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6 <title>py-configparser API documentation</title>
7 <link rel="stylesheet" type="text/css" href="style.css"/>
8 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
9 <style type="text/css">
10 dt.sym {
11 font-weight: normal;
12 background-color: #8ca;
13 border-bottom: 1px solid gray;
14 border-left: 1px solid #bbb;
15 padding-left: 1ex;
16 }
17 .function-name { font-weight: bold }
18 .class-name { font-weight: bold }
19 .slot-name { font-weight: bold }
20 .var-name { font-weight: bold }
21 dl.faq dt {
22 margin-top: 1em;
23 font-weight: bold;
24 font-size: larger;
25 }
26 pre {
27 background-color: #ace;
28 padding: 1ex;
29 border: 1px solid black;
30 }
31 </style>
32 </head>
33 <body>
34
35 <ul>
36 <li><a href="#docs">API documentation</a></li>
37 <li><a href="#faqs">How do I ... (FAQ)</a></li>
38 </ul>
39
40 <h1><a name="docs">py-configparser API documentation</a></h1>
41
42 <p style="font-size:8px">$Id$ <br />
43 Work in progress.</p>
44
45 <p>Please note that we're committed to supporting the same
46 interface as the ConfigParser module, <em>with exceptions</em>.
47 The exceptions are mostly related to maintenance of ordering
48 of sections and options: whereas the Python module doesn't maintain
49 the order encountered in the file, this implementation does.</p>
50
51
52 <h2>Functions for creation and manipulation of configurations</h2>
53
54 <dl>
55 <dt class="sym"><span class="function-name">make-config</span>
56 &amp;key default sections option-name-transform-fn
57 section-name-transform-fn =&gt; config</dt>
58
59 <dd>
60 <p>Creates a config structure used as in-memory storage of the
61 configuration.</p>
62
63 <p>The <em>default</em> and <em>sections</em> arguments should not be
64 used and may
65 be removed in newer releases. The <em>option-name-transform-fn</em> and <em>
66 section-name-transform-fn</em> arguments are to be functions used to
67 normalise section and option names. The default value for the former
68 is #'string-downcase, while the default for the latter is #'identity.
69 </p></dd>
70
71 <dt class="sym">
72 <span class="function-name">defaults</span> config =&gt; alist</dt>
73 <dd><p>Returns a of dotted lists where the car is the key and the
74 cdr the associated value.
75 </p></dd>
76
77 <dt class="sym">
78 <span class="function-name">sections</span> config =&gt; list</dt>
79 <dd><p>Returns a list of section names, excluding the default section.</p></dd>
80
81 <dt class="sym">
82 <span class="function-name">has-section-p</span> config section-name
83 =&gt; generalised boolean </dt>
84 <dd><p>Returns NIL if the specified section is not contained in the
85 config object. A non-NIL value is returned otherwise. </p>
86
87 <p>The transformation functions are applied to the section name.</p></dd>
88
89 <dt class="sym">
90 <span class="function-name">add-section</span> config section-name</dt>
91 <dd><p>Adds a new section to the config object.</p>
92
93 <p>If the section already exists, a &quot;duplicate-section-error&quot;
94 is raised.</p>
95 <p>The transformation functions are applied to the section name
96 before checking for duplicates.</p></dd>
97
98 <dt class="sym">
99 <span class="function-name">options</span> config section-name
100 =&gt; unspecified</dt>
101 <dd><p>Returns the list of options which are defined for the specified
102 section.</p>
103 <p>The transformation functions are applied to section-name.</p></dd>
104
105 <dt class="sym">
106 <span class="function-name">has-option-p</span>
107 config section-name option-name =&gt; generalised boolean</dt>
108 <dd><p>Returns NIL when the specified option does not exist within the
109 specified section of the config object. A non-NIL value is returned
110 otherwise.</p>
111
112 <p>The transformation functions are applied to section-name and
113 option-name.</p></dd>
114
115 <dt class="sym">
116 <span class="function-name">get-option</span> config section-name
117 option-name &amp;key expand defaults type =&gt; value</dt>
118 <dd><p>Returns the value of the specified option with type &quot;type&quot;,
119 if specified. Values which contain interpolations are expanded by default,
120 but this behaviour can be turned off by passing NIL for &quot;expand&quot;.
121 </p>
122
123 <p>Defaults may be provided for interpolated values by passing an alist
124 for &quot;defaults&quot;, where the car specifies the %()s argument
125 name and the cdr specifies the value to be used in its place.</p>
126
127 <p>The transformation functions are applied to section-name and
128 option-name. </p></dd>
129
130 <dt class="sym">
131 <span class="function-name">set-option</span> config section-name
132 option-name value =&gt; unspecified</dt>
133 <dd><p>Sets the value of the specified option in the specified section
134 of the config object.</p>
135
136 <p>If the section does not exist, a &quot;no-section-error&quot; is
137 raised. If the option does not exist, it's created.</p></dd>
138
139 <dt class="sym">
140 <span class="function-name">items</span> config section-name
141 &amp;key expand defaults =&gt; alist</dt>
142 <dd><p>Returns an alist of items of the specified section of the given config
143 object. By default, values are expanded, using &quot;defaults&quot; when
144 given. The format of defaults is the same as for get-option.</p>
145
146 <p>The transformation functions are applied to the section name.</p>
147
148 <p>To disable expansion of the values, you need to specify NIL for
149 &quot;expand&quot;.</p></dd>
150
151 <dt class="sym">
152 <span class="function-name">remove-option</span> config section-name
153 option-name =&gt; unspecified</dt>
154 <dd><p>Removes the specified option from the given section of the config
155 object.</p></dd>
156
157 <dt class="sym">
158 <span class="function-name">remove-section</span> config section-name
159 =&gt; unspecified</dt>
160 <dd><p>Removes the specified section from the config object.</p>
161 <p>If the default section (&quot;DEFAULT&quot;) is specified,
162 an error is raised, because it can't be removed.</p></dd>
163
164 <dt class="sym">
165 <span class="function-name">read-files</span> config filenames =&gt; list</dt>
166 <dd><p>Reads the files in the filenames list, incrementally adding and
167 overwriting values in the config object.</p>
168
169 <p>Returns the list of files succesfully read. Note however that
170 files can only be succesfully skipped by non-existance. If an error
171 occurs while parsing one of the files, further reading will be
172 aborted, raising the error instead.</p></dd>
173
174 <dt class="sym">
175 <span class="function-name">read-stream</span> config stream
176 &amp;key stream-name =&gt; config</dt>
177 <dd><p>Returns the config object with the sections and options read from
178 the stream overwriting any pre-existing values.</p>
179 <p>All characters on the stream are read. If an error occurs,
180 processing stops and the error is raised.</p></dd>
181
182 </dl>
183
184 <h2>Classes</h2>
185
186 <p><em>none</em></p>
187
188 <h2>Variables / constants</h2>
189
190 <p><em>none</em></p>
191
192 <h2>Conditions</h2>
193
194 <p>To be documented</p>
195
196 <h1><a name="faqs">How do I ...</a></h1>
197
198 <p>To be written</p>
199
200
201 <div style="float:left;font-size:x-small;font-weight:bold">
202 Back to <a href="http://common-lisp.net/">Common-lisp.net</a>.
203 </div>
204 <div class="check" style="float:right">
205 <a href="http://validator.w3.org/check/referer">Valid XHTML 1.0 Strict</a>
206 </div>
207 </body>
208 </html>

Properties

Name Value
svn:keywords Id URL

  ViewVC Help
Powered by ViewVC 1.1.5