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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Module: __init__</title>
</head>
<body bgcolor="#ffffff">
<p><i><a href="../../../index.html">Table of Contents</a></i></p>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<th rowspan="2"
valign="top"
align="left"
width="10%"
bgcolor="#88bbee"><font color="#000000">Module: __init__</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">../HappyDoc-r2_1/happydoclib/parseinfo/__init__.py</font>
</th>
</tr>
<tr>
<td>
<h3>Extract information from a Python code parse tree.</h3>
<p> This module is based on the Demos/parser/example.py module
distributed with the Python source distribution.</p>
<h4> File-specific Parser Configuration Values</h4>
<p> Parameters to the HappyDoc Parser can also be embedded within the
first comment block of the module. The parameter values
recognized and their meanings are listed below.</p>
<p> To provide file-specific parser configuration settings, any Python
code can be embedded in the comments of the file. For example:
<pre>
#!/usr/bin/env python
#
# HappyDoc:# These variables should be discovered.
# HappyDoc:TestInt=1
# HappyDoc:TestString="String"
# HappyDoc:TestStringModule=string.strip(' this has spaces in front and back ')
# HappyDoc:url=urlencode({'a':'A', 'b':'B'})
# HappyDoc:docStringFormat='StructuredText'
</pre>
</p>
<p> All lines beginning with the pattern "<code># HappyDoc:</code>" will be
concatenated (separated by newlines) and <code>execed</code>. The local
namespace resulting from the execution of the code will be
examined for variables of interest to the parser. The incoming
global namespace for the configuration code will have a few
pre-populated names for convenience.</p>
<h5> Pre-defined Globals</h5>
<table border="1" cellpadding="2">
<tr>
<th colspan="1" align="left" valign="middle"><p> Name </p>
</th>
<th colspan="1" align="left" valign="middle"><p> Description </p>
</th>
</tr>
<tr>
<td colspan="1" align="left" valign="middle"><p> string </p>
</td>
<td colspan="1" align="left" valign="middle"><p> The <code>string</code> module. </p>
</td>
</tr>
<tr>
<td colspan="1" align="left" valign="middle"><p> urlquote </p>
</td>
<td colspan="1" align="left" valign="middle"><p> Same as <code>urllib.quote</code> function. </p>
</td>
</tr>
<tr>
<td colspan="1" align="left" valign="middle"><p> urlencode </p>
</td>
<td colspan="1" align="left" valign="middle"><p> Same as <code>urllib.urlencode</code> function. </p>
</td>
</tr>
</table>
<h5> Recognized Parser Configuration Variables</h5>
<table border="1" cellpadding="2">
<tr>
<th colspan="1" align="left" valign="middle"><p> Parameter </p>
</th>
<th colspan="1" align="left" valign="middle"><p> Description </p>
</th>
</tr>
<tr>
<td colspan="1" align="left" valign="top"><p> docStringFormat </p>
</td>
<td colspan="1" align="left" valign="middle"><p> The name of the format for the <code>__doc__</code>
strings in the module. This value is used
to determine the docstring converter which
will know how to translate the docstrings in
the module. </p>
</td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="Imported modules">Imported modules</a>
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000"> </font>
</th>
</tr>
<tr>
<td>
<b>import</b> <a href="../../../happydoclib/index.html">happydoclib</a><br>
<b>from</b> happydoclib.StreamFlushTest <b>import</b> StreamFlushTest<br>
<b>import</b> happydoclib.parsecomments<br>
<b>from</b> happydoclib.parseinfo.moduleinfo <b>import</b> ModuleInfo<br>
<b>import</b> happydoclib.path<br>
<b>import</b> <a href="http://www.python.org/doc/current/lib/module-parser.html">parser</a><br>
<b>import</b> <a href="http://www.python.org/doc/current/lib/module-types.html">types</a><br>
</td></tr>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="Functions">Functions</a>
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000"> </font>
</th>
</tr>
<tr>
<td>
<a href="#getDocs">getDocs</a><br>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="getDocs"></a>
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">getDocs </font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
getDocs (
parent,
fileName,
includeComments=1,
defaultConfigValues={},
)
</pre></font>
<h3>Retrieve information from the parse tree of a source file.</h3>
<h4> Parameters</h4>
<dl>
<dt> fileName</dt>
<dd>Name of the file to read Python source code from.</dd>
<dt> includeComments=1</dt>
<dd>Flag to indicate whether comments should be parsed for
cases where __doc__ strings are not available.</dd>
</dl>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="Exceptions">Exceptions</a>
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000"> </font>
</th>
</tr>
<tr>
<td>
TypeError( msg, source )<br>
</td></tr>
</table>
</td></tr>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="Classes">Classes</a>
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000"> </font>
</th>
</tr>
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="0">
<tr><td valign="top" align="left"><p><a href="__init__/ParserUnitTest.html">ParserUnitTest</a></p></td><td valign="top" align="left"></td></tr>
</table>
</td></tr>
</td></tr>
</table>
</td>
</tr>
</table>
<hr>
<p><i><a href="../../../index.html">Table of Contents</a></i></p>
<font size="-2"><i>This document was automatically generated
on Sat Aug 24 16:57:40 2002 by
<a href="http://happydoc.sourceforge.net">HappyDoc</a> version
2.1</i></font>
</body>
</html>
|