|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric4.Utilities.ClassBrowsers.pyclbr</title> |
|
6 <style> |
|
7 body { |
|
8 background:white; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #4FA4FF; } |
|
14 h2 { color: white; background: #4FA4FF; } |
|
15 h3 { color: white; background: #00557F; } |
|
16 h4 { color: white; background: #00557F; } |
|
17 |
|
18 a { color: #AA5500; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric4.Utilities.ClassBrowsers.pyclbr</h1> |
|
24 <p> |
|
25 Parse a Python file and retrieve classes, functions/methods and attributes. |
|
26 </p><p> |
|
27 Parse enough of a Python file to recognize class and method definitions and |
|
28 to find out the superclasses of a class as well as its attributes. |
|
29 </p><p> |
|
30 This is module is based on pyclbr found in the Python 2.2.2 distribution. |
|
31 </p> |
|
32 <h3>Global Attributes</h3> |
|
33 <table> |
|
34 <tr><td>SUPPORTED_TYPES</td></tr><tr><td>TABWIDTH</td></tr><tr><td>_commentsub</td></tr><tr><td>_getnext</td></tr><tr><td>_modules</td></tr> |
|
35 </table> |
|
36 <h3>Classes</h3> |
|
37 <table> |
|
38 <tr> |
|
39 <td><a href="#Attribute">Attribute</a></td> |
|
40 <td>Class to represent a class attribute.</td> |
|
41 </tr><tr> |
|
42 <td><a href="#Class">Class</a></td> |
|
43 <td>Class to represent a Python class.</td> |
|
44 </tr><tr> |
|
45 <td><a href="#Function">Function</a></td> |
|
46 <td>Class to represent a Python function.</td> |
|
47 </tr><tr> |
|
48 <td><a href="#Publics">Publics</a></td> |
|
49 <td>Class to represent the list of public identifiers.</td> |
|
50 </tr><tr> |
|
51 <td><a href="#VisibilityMixin">VisibilityMixin</a></td> |
|
52 <td>Mixin class implementing the notion of visibility.</td> |
|
53 </tr> |
|
54 </table> |
|
55 <h3>Functions</h3> |
|
56 <table> |
|
57 <tr> |
|
58 <td><a href="#_indent">_indent</a></td> |
|
59 <td>Module function to return the indentation depth.</td> |
|
60 </tr><tr> |
|
61 <td><a href="#readmodule_ex">readmodule_ex</a></td> |
|
62 <td>Read a module file and return a dictionary of classes.</td> |
|
63 </tr> |
|
64 </table> |
|
65 <hr /><hr /> |
|
66 <a NAME="Attribute" ID="Attribute"></a> |
|
67 <h2>Attribute</h2> |
|
68 <p> |
|
69 Class to represent a class attribute. |
|
70 </p> |
|
71 <h3>Derived from</h3> |
|
72 ClbrBaseClasses.Attribute, VisibilityMixin |
|
73 <h3>Class Attributes</h3> |
|
74 <table> |
|
75 <tr><td>None</td></tr> |
|
76 </table> |
|
77 <h3>Methods</h3> |
|
78 <table> |
|
79 <tr> |
|
80 <td><a href="#Attribute.__init__">Attribute</a></td> |
|
81 <td>Constructor</td> |
|
82 </tr> |
|
83 </table> |
|
84 <a NAME="Attribute.__init__" ID="Attribute.__init__"></a> |
|
85 <h4>Attribute (Constructor)</h4> |
|
86 <b>Attribute</b>(<i>module, name, file, lineno</i>) |
|
87 <p> |
|
88 Constructor |
|
89 </p><dl> |
|
90 <dt><i>module</i></dt> |
|
91 <dd> |
|
92 name of the module containing this class |
|
93 </dd><dt><i>name</i></dt> |
|
94 <dd> |
|
95 name of this class |
|
96 </dd><dt><i>file</i></dt> |
|
97 <dd> |
|
98 filename containing this attribute |
|
99 </dd><dt><i>lineno</i></dt> |
|
100 <dd> |
|
101 linenumber of the class definition |
|
102 </dd> |
|
103 </dl> |
|
104 <div align="right"><a href="#top">Up</a></div> |
|
105 <hr /><hr /> |
|
106 <a NAME="Class" ID="Class"></a> |
|
107 <h2>Class</h2> |
|
108 <p> |
|
109 Class to represent a Python class. |
|
110 </p> |
|
111 <h3>Derived from</h3> |
|
112 ClbrBaseClasses.Class, VisibilityMixin |
|
113 <h3>Class Attributes</h3> |
|
114 <table> |
|
115 <tr><td>None</td></tr> |
|
116 </table> |
|
117 <h3>Methods</h3> |
|
118 <table> |
|
119 <tr> |
|
120 <td><a href="#Class.__init__">Class</a></td> |
|
121 <td>Constructor</td> |
|
122 </tr> |
|
123 </table> |
|
124 <a NAME="Class.__init__" ID="Class.__init__"></a> |
|
125 <h4>Class (Constructor)</h4> |
|
126 <b>Class</b>(<i>module, name, super, file, lineno</i>) |
|
127 <p> |
|
128 Constructor |
|
129 </p><dl> |
|
130 <dt><i>module</i></dt> |
|
131 <dd> |
|
132 name of the module containing this class |
|
133 </dd><dt><i>name</i></dt> |
|
134 <dd> |
|
135 name of this class |
|
136 </dd><dt><i>super</i></dt> |
|
137 <dd> |
|
138 list of class names this class is inherited from |
|
139 </dd><dt><i>file</i></dt> |
|
140 <dd> |
|
141 filename containing this class |
|
142 </dd><dt><i>lineno</i></dt> |
|
143 <dd> |
|
144 linenumber of the class definition |
|
145 </dd> |
|
146 </dl> |
|
147 <div align="right"><a href="#top">Up</a></div> |
|
148 <hr /><hr /> |
|
149 <a NAME="Function" ID="Function"></a> |
|
150 <h2>Function</h2> |
|
151 <p> |
|
152 Class to represent a Python function. |
|
153 </p> |
|
154 <h3>Derived from</h3> |
|
155 ClbrBaseClasses.Function, VisibilityMixin |
|
156 <h3>Class Attributes</h3> |
|
157 <table> |
|
158 <tr><td>None</td></tr> |
|
159 </table> |
|
160 <h3>Methods</h3> |
|
161 <table> |
|
162 <tr> |
|
163 <td><a href="#Function.__init__">Function</a></td> |
|
164 <td>Constructor</td> |
|
165 </tr> |
|
166 </table> |
|
167 <a NAME="Function.__init__" ID="Function.__init__"></a> |
|
168 <h4>Function (Constructor)</h4> |
|
169 <b>Function</b>(<i>module, name, file, lineno, signature = '', separator = ', '</i>) |
|
170 <p> |
|
171 Constructor |
|
172 </p><dl> |
|
173 <dt><i>module</i></dt> |
|
174 <dd> |
|
175 name of the module containing this function |
|
176 </dd><dt><i>name</i></dt> |
|
177 <dd> |
|
178 name of this function |
|
179 </dd><dt><i>file</i></dt> |
|
180 <dd> |
|
181 filename containing this class |
|
182 </dd><dt><i>lineno</i></dt> |
|
183 <dd> |
|
184 linenumber of the class definition |
|
185 </dd><dt><i>signature</i></dt> |
|
186 <dd> |
|
187 parameterlist of the method |
|
188 </dd><dt><i>separator</i></dt> |
|
189 <dd> |
|
190 string separating the parameters |
|
191 </dd> |
|
192 </dl> |
|
193 <div align="right"><a href="#top">Up</a></div> |
|
194 <hr /><hr /> |
|
195 <a NAME="Publics" ID="Publics"></a> |
|
196 <h2>Publics</h2> |
|
197 <p> |
|
198 Class to represent the list of public identifiers. |
|
199 </p> |
|
200 <h3>Derived from</h3> |
|
201 object |
|
202 <h3>Class Attributes</h3> |
|
203 <table> |
|
204 <tr><td>None</td></tr> |
|
205 </table> |
|
206 <h3>Methods</h3> |
|
207 <table> |
|
208 <tr> |
|
209 <td><a href="#Publics.__init__">Publics</a></td> |
|
210 <td>Constructor</td> |
|
211 </tr> |
|
212 </table> |
|
213 <a NAME="Publics.__init__" ID="Publics.__init__"></a> |
|
214 <h4>Publics (Constructor)</h4> |
|
215 <b>Publics</b>(<i>module, file, lineno, idents</i>) |
|
216 <p> |
|
217 Constructor |
|
218 </p><dl> |
|
219 <dt><i>module</i></dt> |
|
220 <dd> |
|
221 name of the module containing this function |
|
222 </dd><dt><i>file</i></dt> |
|
223 <dd> |
|
224 filename containing this class |
|
225 </dd><dt><i>lineno</i></dt> |
|
226 <dd> |
|
227 linenumber of the class definition |
|
228 </dd><dt><i>idents</i></dt> |
|
229 <dd> |
|
230 list of public identifiers |
|
231 </dd> |
|
232 </dl> |
|
233 <div align="right"><a href="#top">Up</a></div> |
|
234 <hr /><hr /> |
|
235 <a NAME="VisibilityMixin" ID="VisibilityMixin"></a> |
|
236 <h2>VisibilityMixin</h2> |
|
237 <p> |
|
238 Mixin class implementing the notion of visibility. |
|
239 </p> |
|
240 <h3>Derived from</h3> |
|
241 ClbrBaseClasses.ClbrVisibilityMixinBase |
|
242 <h3>Class Attributes</h3> |
|
243 <table> |
|
244 <tr><td>None</td></tr> |
|
245 </table> |
|
246 <h3>Methods</h3> |
|
247 <table> |
|
248 <tr> |
|
249 <td><a href="#VisibilityMixin.__init__">VisibilityMixin</a></td> |
|
250 <td>Method to initialize the visibility.</td> |
|
251 </tr> |
|
252 </table> |
|
253 <a NAME="VisibilityMixin.__init__" ID="VisibilityMixin.__init__"></a> |
|
254 <h4>VisibilityMixin (Constructor)</h4> |
|
255 <b>VisibilityMixin</b>(<i></i>) |
|
256 <p> |
|
257 Method to initialize the visibility. |
|
258 </p> |
|
259 <div align="right"><a href="#top">Up</a></div> |
|
260 <hr /><hr /> |
|
261 <a NAME="_indent" ID="_indent"></a> |
|
262 <h2>_indent</h2> |
|
263 <b>_indent</b>(<i>ws</i>) |
|
264 <p> |
|
265 Module function to return the indentation depth. |
|
266 </p><dl> |
|
267 <dt><i>ws</i></dt> |
|
268 <dd> |
|
269 the whitespace to be checked (string) |
|
270 </dd> |
|
271 </dl><dl> |
|
272 <dt>Returns:</dt> |
|
273 <dd> |
|
274 length of the whitespace string (integer) |
|
275 </dd> |
|
276 </dl> |
|
277 <div align="right"><a href="#top">Up</a></div> |
|
278 <hr /><hr /> |
|
279 <a NAME="readmodule_ex" ID="readmodule_ex"></a> |
|
280 <h2>readmodule_ex</h2> |
|
281 <b>readmodule_ex</b>(<i>module, path=[], inpackage = False, isPyFile = False</i>) |
|
282 <p> |
|
283 Read a module file and return a dictionary of classes. |
|
284 </p><p> |
|
285 Search for MODULE in PATH and sys.path, read and parse the |
|
286 module and return a dictionary with one entry for each class |
|
287 found in the module. |
|
288 </p><dl> |
|
289 <dt><i>module</i></dt> |
|
290 <dd> |
|
291 name of the module file (string) |
|
292 </dd><dt><i>path</i></dt> |
|
293 <dd> |
|
294 path the module should be searched in (list of strings) |
|
295 </dd><dt><i>inpackage</i></dt> |
|
296 <dd> |
|
297 flag indicating a module inside a package is scanned |
|
298 </dd> |
|
299 </dl><dl> |
|
300 <dt>Returns:</dt> |
|
301 <dd> |
|
302 the resulting dictionary |
|
303 </dd> |
|
304 </dl> |
|
305 <div align="right"><a href="#top">Up</a></div> |
|
306 <hr /> |
|
307 </body></html> |