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