src/eric7/Documentation/Source/eric7.Utilities.ModuleParser.html

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8596
d64760b2da50
child 9236
db53a9efe7ef
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.Utilities.ModuleParser</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.Utilities.ModuleParser</h1>
10
11 <p>
12 Parse a Python module file.
13 </p>
14 <p>
15 <b>BUGS</b> (from pyclbr.py)
16 <ul>
17 <li>Code that doesn't pass tabnanny or python -t will confuse it, unless
18 you set the module TABWIDTH variable (default 8) to the correct tab width
19 for the file.</li>
20 </ul>
21 </p>
22 <h3>Global Attributes</h3>
23
24 <table>
25 <tr><td>PTL_SOURCE</td></tr><tr><td>PY_SOURCE</td></tr><tr><td>RB_SOURCE</td></tr><tr><td>SEARCH_ERROR</td></tr><tr><td>SUPPORTED_TYPES</td></tr><tr><td>TABWIDTH</td></tr><tr><td>TYPE_MAPPING</td></tr><tr><td>__all__</td></tr><tr><td>_commentsub</td></tr><tr><td>_hashsub</td></tr><tr><td>_modules</td></tr><tr><td>_py_getnext</td></tr><tr><td>_rb_getnext</td></tr>
26 </table>
27 <h3>Classes</h3>
28
29 <table>
30
31 <tr>
32 <td><a href="#Attribute">Attribute</a></td>
33 <td>Class to represent a Python function or method.</td>
34 </tr>
35 <tr>
36 <td><a href="#Class">Class</a></td>
37 <td>Class to represent a Python class.</td>
38 </tr>
39 <tr>
40 <td><a href="#Function">Function</a></td>
41 <td>Class to represent a Python function or method.</td>
42 </tr>
43 <tr>
44 <td><a href="#Module">Module</a></td>
45 <td>Class to represent a Python module.</td>
46 </tr>
47 <tr>
48 <td><a href="#RbModule">RbModule</a></td>
49 <td>Class to represent a Ruby module.</td>
50 </tr>
51 <tr>
52 <td><a href="#VisibilityBase">VisibilityBase</a></td>
53 <td>Class implementing the visibility aspect of all objects.</td>
54 </tr>
55 </table>
56 <h3>Functions</h3>
57
58 <table>
59
60 <tr>
61 <td><a href="#_indent">_indent</a></td>
62 <td>Protected function to determine the indent width of a whitespace string.</td>
63 </tr>
64 <tr>
65 <td><a href="#find_module">find_module</a></td>
66 <td>Module function to extend the Python module finding mechanism.</td>
67 </tr>
68 <tr>
69 <td><a href="#getTypeFromTypeName">getTypeFromTypeName</a></td>
70 <td>Module function to determine the module type given the module type name.</td>
71 </tr>
72 <tr>
73 <td><a href="#readModule">readModule</a></td>
74 <td>Function to read a module file and parse it.</td>
75 </tr>
76 <tr>
77 <td><a href="#resetParsedModule">resetParsedModule</a></td>
78 <td>Module function to clear one module from the list of parsed modules.</td>
79 </tr>
80 <tr>
81 <td><a href="#resetParsedModules">resetParsedModules</a></td>
82 <td>Module function to reset the list of modules already parsed.</td>
83 </tr>
84 </table>
85 <hr />
86 <hr />
87 <a NAME="Attribute" ID="Attribute"></a>
88 <h2>Attribute</h2>
89
90 <p>
91 Class to represent a Python function or method.
92 </p>
93 <h3>Derived from</h3>
94 VisibilityBase
95 <h3>Class Attributes</h3>
96
97 <table>
98 <tr><td>None</td></tr>
99 </table>
100 <h3>Class Methods</h3>
101
102 <table>
103 <tr><td>None</td></tr>
104 </table>
105 <h3>Methods</h3>
106
107 <table>
108
109 <tr>
110 <td><a href="#Attribute.__init__">Attribute</a></td>
111 <td>Constructor</td>
112 </tr>
113 <tr>
114 <td><a href="#Attribute.addAssignment">addAssignment</a></td>
115 <td>Public method to add another assignment line number.</td>
116 </tr>
117 </table>
118 <h3>Static Methods</h3>
119
120 <table>
121 <tr><td>None</td></tr>
122 </table>
123
124 <a NAME="Attribute.__init__" ID="Attribute.__init__"></a>
125 <h4>Attribute (Constructor)</h4>
126 <b>Attribute</b>(<i>module, name, file, lineno, isSignal=False</i>)
127
128 <p>
129 Constructor
130 </p>
131 <dl>
132
133 <dt><i>module</i></dt>
134 <dd>
135 name of module containing this function (string)
136 </dd>
137 <dt><i>name</i></dt>
138 <dd>
139 name of the function (string)
140 </dd>
141 <dt><i>file</i></dt>
142 <dd>
143 name of file containing this function (string)
144 </dd>
145 <dt><i>lineno</i></dt>
146 <dd>
147 linenumber of the first attribute assignment (integer)
148 </dd>
149 <dt><i>isSignal</i></dt>
150 <dd>
151 flag indicating a signal definition (boolean)
152 </dd>
153 </dl>
154 <a NAME="Attribute.addAssignment" ID="Attribute.addAssignment"></a>
155 <h4>Attribute.addAssignment</h4>
156 <b>addAssignment</b>(<i>lineno</i>)
157
158 <p>
159 Public method to add another assignment line number.
160 </p>
161 <dl>
162
163 <dt><i>lineno</i></dt>
164 <dd>
165 linenumber of the additional attribute assignment
166 (integer)
167 </dd>
168 </dl>
169 <div align="right"><a href="#top">Up</a></div>
170 <hr />
171 <hr />
172 <a NAME="Class" ID="Class"></a>
173 <h2>Class</h2>
174
175 <p>
176 Class to represent a Python class.
177 </p>
178 <h3>Derived from</h3>
179 VisibilityBase
180 <h3>Class Attributes</h3>
181
182 <table>
183 <tr><td>None</td></tr>
184 </table>
185 <h3>Class Methods</h3>
186
187 <table>
188 <tr><td>None</td></tr>
189 </table>
190 <h3>Methods</h3>
191
192 <table>
193
194 <tr>
195 <td><a href="#Class.__init__">Class</a></td>
196 <td>Constructor</td>
197 </tr>
198 <tr>
199 <td><a href="#Class.addAttribute">addAttribute</a></td>
200 <td>Public method to add information about attributes.</td>
201 </tr>
202 <tr>
203 <td><a href="#Class.addDescription">addDescription</a></td>
204 <td>Public method to store the class docstring.</td>
205 </tr>
206 <tr>
207 <td><a href="#Class.addGlobal">addGlobal</a></td>
208 <td>Public method to add information about global (class) variables.</td>
209 </tr>
210 <tr>
211 <td><a href="#Class.addMethod">addMethod</a></td>
212 <td>Public method to add information about a method.</td>
213 </tr>
214 <tr>
215 <td><a href="#Class.getAttribute">getAttribute</a></td>
216 <td>Public method to retrieve an attribute by name.</td>
217 </tr>
218 <tr>
219 <td><a href="#Class.getMethod">getMethod</a></td>
220 <td>Public method to retrieve a method by name.</td>
221 </tr>
222 <tr>
223 <td><a href="#Class.setEndLine">setEndLine</a></td>
224 <td>Public method to record the number of the last line of a class.</td>
225 </tr>
226 </table>
227 <h3>Static Methods</h3>
228
229 <table>
230 <tr><td>None</td></tr>
231 </table>
232
233 <a NAME="Class.__init__" ID="Class.__init__"></a>
234 <h4>Class (Constructor)</h4>
235 <b>Class</b>(<i>module, name, superClasses, file, lineno</i>)
236
237 <p>
238 Constructor
239 </p>
240 <dl>
241
242 <dt><i>module</i></dt>
243 <dd>
244 name of module containing this class (string)
245 </dd>
246 <dt><i>name</i></dt>
247 <dd>
248 name of the class (string)
249 </dd>
250 <dt><i>superClasses</i></dt>
251 <dd>
252 list of classnames this class is inherited from
253 (list of strings)
254 </dd>
255 <dt><i>file</i></dt>
256 <dd>
257 name of file containing this class (string)
258 </dd>
259 <dt><i>lineno</i></dt>
260 <dd>
261 linenumber of the class definition (integer)
262 </dd>
263 </dl>
264 <a NAME="Class.addAttribute" ID="Class.addAttribute"></a>
265 <h4>Class.addAttribute</h4>
266 <b>addAttribute</b>(<i>name, attr</i>)
267
268 <p>
269 Public method to add information about attributes.
270 </p>
271 <dl>
272
273 <dt><i>name</i></dt>
274 <dd>
275 name of the attribute to add (string)
276 </dd>
277 <dt><i>attr</i></dt>
278 <dd>
279 Attribute object to be added
280 </dd>
281 </dl>
282 <a NAME="Class.addDescription" ID="Class.addDescription"></a>
283 <h4>Class.addDescription</h4>
284 <b>addDescription</b>(<i>description</i>)
285
286 <p>
287 Public method to store the class docstring.
288 </p>
289 <dl>
290
291 <dt><i>description</i></dt>
292 <dd>
293 the docstring to be stored (string)
294 </dd>
295 </dl>
296 <a NAME="Class.addGlobal" ID="Class.addGlobal"></a>
297 <h4>Class.addGlobal</h4>
298 <b>addGlobal</b>(<i>name, attr</i>)
299
300 <p>
301 Public method to add information about global (class) variables.
302 </p>
303 <dl>
304
305 <dt><i>name</i></dt>
306 <dd>
307 name of the global to add (string)
308 </dd>
309 <dt><i>attr</i></dt>
310 <dd>
311 Attribute object to be added
312 </dd>
313 </dl>
314 <a NAME="Class.addMethod" ID="Class.addMethod"></a>
315 <h4>Class.addMethod</h4>
316 <b>addMethod</b>(<i>name, function</i>)
317
318 <p>
319 Public method to add information about a method.
320 </p>
321 <dl>
322
323 <dt><i>name</i></dt>
324 <dd>
325 name of method to be added (string)
326 </dd>
327 <dt><i>function</i></dt>
328 <dd>
329 Function object to be added
330 </dd>
331 </dl>
332 <a NAME="Class.getAttribute" ID="Class.getAttribute"></a>
333 <h4>Class.getAttribute</h4>
334 <b>getAttribute</b>(<i>name</i>)
335
336 <p>
337 Public method to retrieve an attribute by name.
338 </p>
339 <dl>
340
341 <dt><i>name</i></dt>
342 <dd>
343 name of the attribute (string)
344 </dd>
345 </dl>
346 <dl>
347 <dt>Return:</dt>
348 <dd>
349 the named attribute or None
350 </dd>
351 </dl>
352 <a NAME="Class.getMethod" ID="Class.getMethod"></a>
353 <h4>Class.getMethod</h4>
354 <b>getMethod</b>(<i>name</i>)
355
356 <p>
357 Public method to retrieve a method by name.
358 </p>
359 <dl>
360
361 <dt><i>name</i></dt>
362 <dd>
363 name of the method (string)
364 </dd>
365 </dl>
366 <dl>
367 <dt>Return:</dt>
368 <dd>
369 the named method or None
370 </dd>
371 </dl>
372 <a NAME="Class.setEndLine" ID="Class.setEndLine"></a>
373 <h4>Class.setEndLine</h4>
374 <b>setEndLine</b>(<i>endLineNo</i>)
375
376 <p>
377 Public method to record the number of the last line of a class.
378 </p>
379 <dl>
380
381 <dt><i>endLineNo</i></dt>
382 <dd>
383 number of the last line (integer)
384 </dd>
385 </dl>
386 <div align="right"><a href="#top">Up</a></div>
387 <hr />
388 <hr />
389 <a NAME="Function" ID="Function"></a>
390 <h2>Function</h2>
391
392 <p>
393 Class to represent a Python function or method.
394 </p>
395 <h3>Derived from</h3>
396 VisibilityBase
397 <h3>Class Attributes</h3>
398
399 <table>
400 <tr><td>Class</td></tr><tr><td>General</td></tr><tr><td>Static</td></tr>
401 </table>
402 <h3>Class Methods</h3>
403
404 <table>
405 <tr><td>None</td></tr>
406 </table>
407 <h3>Methods</h3>
408
409 <table>
410
411 <tr>
412 <td><a href="#Function.__init__">Function</a></td>
413 <td>Constructor</td>
414 </tr>
415 <tr>
416 <td><a href="#Function.addDescription">addDescription</a></td>
417 <td>Public method to store the functions docstring.</td>
418 </tr>
419 <tr>
420 <td><a href="#Function.setEndLine">setEndLine</a></td>
421 <td>Public method to record the number of the last line of a class.</td>
422 </tr>
423 </table>
424 <h3>Static Methods</h3>
425
426 <table>
427 <tr><td>None</td></tr>
428 </table>
429
430 <a NAME="Function.__init__" ID="Function.__init__"></a>
431 <h4>Function (Constructor)</h4>
432 <b>Function</b>(<i>module, name, file, lineno, signature='', pyqtSignature=None, modifierType=General, annotation=""</i>)
433
434 <p>
435 Constructor
436 </p>
437 <dl>
438
439 <dt><i>module</i></dt>
440 <dd>
441 name of module containing this function (string)
442 </dd>
443 <dt><i>name</i></dt>
444 <dd>
445 name of the function (string)
446 </dd>
447 <dt><i>file</i></dt>
448 <dd>
449 name of file containing this function (string)
450 </dd>
451 <dt><i>lineno</i></dt>
452 <dd>
453 linenumber of the function definition (integer)
454 </dd>
455 <dt><i>signature</i></dt>
456 <dd>
457 the functions call signature (string)
458 </dd>
459 <dt><i>pyqtSignature</i></dt>
460 <dd>
461 the functions PyQt signature (string)
462 </dd>
463 <dt><i>modifierType</i></dt>
464 <dd>
465 type of the function
466 </dd>
467 <dt><i>annotation</i></dt>
468 <dd>
469 return annotation
470 </dd>
471 </dl>
472 <a NAME="Function.addDescription" ID="Function.addDescription"></a>
473 <h4>Function.addDescription</h4>
474 <b>addDescription</b>(<i>description</i>)
475
476 <p>
477 Public method to store the functions docstring.
478 </p>
479 <dl>
480
481 <dt><i>description</i></dt>
482 <dd>
483 the docstring to be stored (string)
484 </dd>
485 </dl>
486 <a NAME="Function.setEndLine" ID="Function.setEndLine"></a>
487 <h4>Function.setEndLine</h4>
488 <b>setEndLine</b>(<i>endLineNo</i>)
489
490 <p>
491 Public method to record the number of the last line of a class.
492 </p>
493 <dl>
494
495 <dt><i>endLineNo</i></dt>
496 <dd>
497 number of the last line (integer)
498 </dd>
499 </dl>
500 <div align="right"><a href="#top">Up</a></div>
501 <hr />
502 <hr />
503 <a NAME="Module" ID="Module"></a>
504 <h2>Module</h2>
505
506 <p>
507 Class to represent a Python module.
508 </p>
509 <h3>Derived from</h3>
510 None
511 <h3>Class Attributes</h3>
512
513 <table>
514 <tr><td>None</td></tr>
515 </table>
516 <h3>Class Methods</h3>
517
518 <table>
519 <tr><td>None</td></tr>
520 </table>
521 <h3>Methods</h3>
522
523 <table>
524
525 <tr>
526 <td><a href="#Module.__init__">Module</a></td>
527 <td>Constructor</td>
528 </tr>
529 <tr>
530 <td><a href="#Module.__py_scan">__py_scan</a></td>
531 <td>Private method to scan the source text of a Python module and retrieve the relevant information.</td>
532 </tr>
533 <tr>
534 <td><a href="#Module.__py_setVisibility">__py_setVisibility</a></td>
535 <td>Private method to set the visibility of an object.</td>
536 </tr>
537 <tr>
538 <td><a href="#Module.__rb_scan">__rb_scan</a></td>
539 <td>Private method to scan the source text of a Python module and retrieve the relevant information.</td>
540 </tr>
541 <tr>
542 <td><a href="#Module.addClass">addClass</a></td>
543 <td>Public method to add information about a class.</td>
544 </tr>
545 <tr>
546 <td><a href="#Module.addDescription">addDescription</a></td>
547 <td>Public method to store the modules docstring.</td>
548 </tr>
549 <tr>
550 <td><a href="#Module.addFunction">addFunction</a></td>
551 <td>Public method to add information about a function.</td>
552 </tr>
553 <tr>
554 <td><a href="#Module.addGlobal">addGlobal</a></td>
555 <td>Public method to add information about global variables.</td>
556 </tr>
557 <tr>
558 <td><a href="#Module.addModule">addModule</a></td>
559 <td>Public method to add information about a Ruby module.</td>
560 </tr>
561 <tr>
562 <td><a href="#Module.addPathToHierarchy">addPathToHierarchy</a></td>
563 <td>Public method to put the exhausted path into the result dictionary.</td>
564 </tr>
565 <tr>
566 <td><a href="#Module.assembleHierarchy">assembleHierarchy</a></td>
567 <td>Public method to assemble the inheritance hierarchy.</td>
568 </tr>
569 <tr>
570 <td><a href="#Module.calculateEndline">calculateEndline</a></td>
571 <td>Function to calculate the end line of a class or method/function.</td>
572 </tr>
573 <tr>
574 <td><a href="#Module.createHierarchy">createHierarchy</a></td>
575 <td>Public method to build the inheritance hierarchy for all classes of this module.</td>
576 </tr>
577 <tr>
578 <td><a href="#Module.getFileName">getFileName</a></td>
579 <td>Public method to retrieve the modules filename.</td>
580 </tr>
581 <tr>
582 <td><a href="#Module.getName">getName</a></td>
583 <td>Public method to retrieve the modules name.</td>
584 </tr>
585 <tr>
586 <td><a href="#Module.getType">getType</a></td>
587 <td>Public method to get the type of the module's source.</td>
588 </tr>
589 <tr>
590 <td><a href="#Module.scan">scan</a></td>
591 <td>Public method to scan the source text and retrieve the relevant information.</td>
592 </tr>
593 </table>
594 <h3>Static Methods</h3>
595
596 <table>
597 <tr><td>None</td></tr>
598 </table>
599
600 <a NAME="Module.__init__" ID="Module.__init__"></a>
601 <h4>Module (Constructor)</h4>
602 <b>Module</b>(<i>name, file=None, moduleType=None</i>)
603
604 <p>
605 Constructor
606 </p>
607 <dl>
608
609 <dt><i>name</i></dt>
610 <dd>
611 name of this module (string)
612 </dd>
613 <dt><i>file</i></dt>
614 <dd>
615 filename of file containing this module (string)
616 </dd>
617 <dt><i>moduleType</i></dt>
618 <dd>
619 type of this module
620 </dd>
621 </dl>
622 <a NAME="Module.__py_scan" ID="Module.__py_scan"></a>
623 <h4>Module.__py_scan</h4>
624 <b>__py_scan</b>(<i>src</i>)
625
626 <p>
627 Private method to scan the source text of a Python module and retrieve
628 the relevant information.
629 </p>
630 <dl>
631
632 <dt><i>src</i></dt>
633 <dd>
634 the source text to be scanned (string)
635 </dd>
636 </dl>
637 <a NAME="Module.__py_setVisibility" ID="Module.__py_setVisibility"></a>
638 <h4>Module.__py_setVisibility</h4>
639 <b>__py_setVisibility</b>(<i>objectRef</i>)
640
641 <p>
642 Private method to set the visibility of an object.
643 </p>
644 <dl>
645
646 <dt><i>objectRef</i></dt>
647 <dd>
648 reference to the object (Attribute, Class or Function)
649 </dd>
650 </dl>
651 <a NAME="Module.__rb_scan" ID="Module.__rb_scan"></a>
652 <h4>Module.__rb_scan</h4>
653 <b>__rb_scan</b>(<i>src</i>)
654
655 <p>
656 Private method to scan the source text of a Python module and retrieve
657 the relevant information.
658 </p>
659 <dl>
660
661 <dt><i>src</i> (str)</dt>
662 <dd>
663 the source text to be scanned
664 </dd>
665 </dl>
666 <a NAME="Module.addClass" ID="Module.addClass"></a>
667 <h4>Module.addClass</h4>
668 <b>addClass</b>(<i>name, _class</i>)
669
670 <p>
671 Public method to add information about a class.
672 </p>
673 <dl>
674
675 <dt><i>name</i></dt>
676 <dd>
677 name of class to be added (string)
678 </dd>
679 <dt><i>_class</i></dt>
680 <dd>
681 Class object to be added
682 </dd>
683 </dl>
684 <a NAME="Module.addDescription" ID="Module.addDescription"></a>
685 <h4>Module.addDescription</h4>
686 <b>addDescription</b>(<i>description</i>)
687
688 <p>
689 Public method to store the modules docstring.
690 </p>
691 <dl>
692
693 <dt><i>description</i></dt>
694 <dd>
695 the docstring to be stored (string)
696 </dd>
697 </dl>
698 <a NAME="Module.addFunction" ID="Module.addFunction"></a>
699 <h4>Module.addFunction</h4>
700 <b>addFunction</b>(<i>name, function</i>)
701
702 <p>
703 Public method to add information about a function.
704 </p>
705 <dl>
706
707 <dt><i>name</i></dt>
708 <dd>
709 name of function to be added (string)
710 </dd>
711 <dt><i>function</i></dt>
712 <dd>
713 Function object to be added
714 </dd>
715 </dl>
716 <a NAME="Module.addGlobal" ID="Module.addGlobal"></a>
717 <h4>Module.addGlobal</h4>
718 <b>addGlobal</b>(<i>name, attr</i>)
719
720 <p>
721 Public method to add information about global variables.
722 </p>
723 <dl>
724
725 <dt><i>name</i></dt>
726 <dd>
727 name of the global to add (string)
728 </dd>
729 <dt><i>attr</i></dt>
730 <dd>
731 Attribute object to be added
732 </dd>
733 </dl>
734 <a NAME="Module.addModule" ID="Module.addModule"></a>
735 <h4>Module.addModule</h4>
736 <b>addModule</b>(<i>name, module</i>)
737
738 <p>
739 Public method to add information about a Ruby module.
740 </p>
741 <dl>
742
743 <dt><i>name</i></dt>
744 <dd>
745 name of module to be added (string)
746 </dd>
747 <dt><i>module</i></dt>
748 <dd>
749 Module object to be added
750 </dd>
751 </dl>
752 <a NAME="Module.addPathToHierarchy" ID="Module.addPathToHierarchy"></a>
753 <h4>Module.addPathToHierarchy</h4>
754 <b>addPathToHierarchy</b>(<i>path, result, fn</i>)
755
756 <p>
757 Public method to put the exhausted path into the result dictionary.
758 </p>
759 <dl>
760
761 <dt><i>path</i></dt>
762 <dd>
763 the exhausted path of classes
764 </dd>
765 <dt><i>result</i></dt>
766 <dd>
767 the result dictionary
768 </dd>
769 <dt><i>fn</i></dt>
770 <dd>
771 function to call for classe that are already part of the
772 result dictionary
773 </dd>
774 </dl>
775 <a NAME="Module.assembleHierarchy" ID="Module.assembleHierarchy"></a>
776 <h4>Module.assembleHierarchy</h4>
777 <b>assembleHierarchy</b>(<i>name, classes, path, result</i>)
778
779 <p>
780 Public method to assemble the inheritance hierarchy.
781 </p>
782 <p>
783 This method will traverse the class hierarchy, from a given class
784 and build up a nested dictionary of super-classes. The result is
785 intended to be inverted, i.e. the highest level are the super classes.
786 </p>
787 <p>
788 This code is borrowed from Boa Constructor.
789 </p>
790 <dl>
791
792 <dt><i>name</i></dt>
793 <dd>
794 name of class to assemble hierarchy (string)
795 </dd>
796 <dt><i>classes</i></dt>
797 <dd>
798 A dictionary of classes to look in.
799 </dd>
800 <dt><i>path</i></dt>
801 <dd>
802
803 </dd>
804 <dt><i>result</i></dt>
805 <dd>
806 The resultant hierarchy
807 </dd>
808 </dl>
809 <a NAME="Module.calculateEndline" ID="Module.calculateEndline"></a>
810 <h4>Module.calculateEndline</h4>
811 <b>calculateEndline</b>(<i>lines, indent</i>)
812
813 <p>
814 Function to calculate the end line of a class or method/function.
815 </p>
816 <dl>
817
818 <dt><i>lineno</i> (int)</dt>
819 <dd>
820 line number to start at (one based)
821 </dd>
822 <dt><i>lines</i> (list of str)</dt>
823 <dd>
824 list of source lines
825 </dd>
826 <dt><i>indent</i> (int)</dt>
827 <dd>
828 indent length the class/method/function definition
829 </dd>
830 </dl>
831 <dl>
832 <dt>Return:</dt>
833 <dd>
834 end line of the class/method/function (one based)
835 </dd>
836 </dl>
837 <dl>
838 <dt>Return Type:</dt>
839 <dd>
840 int
841 </dd>
842 </dl>
843 <a NAME="Module.createHierarchy" ID="Module.createHierarchy"></a>
844 <h4>Module.createHierarchy</h4>
845 <b>createHierarchy</b>(<i></i>)
846
847 <p>
848 Public method to build the inheritance hierarchy for all classes of
849 this module.
850 </p>
851 <dl>
852 <dt>Return:</dt>
853 <dd>
854 A dictionary with inheritance hierarchies.
855 </dd>
856 </dl>
857 <a NAME="Module.getFileName" ID="Module.getFileName"></a>
858 <h4>Module.getFileName</h4>
859 <b>getFileName</b>(<i></i>)
860
861 <p>
862 Public method to retrieve the modules filename.
863 </p>
864 <dl>
865 <dt>Return:</dt>
866 <dd>
867 module filename (string)
868 </dd>
869 </dl>
870 <a NAME="Module.getName" ID="Module.getName"></a>
871 <h4>Module.getName</h4>
872 <b>getName</b>(<i></i>)
873
874 <p>
875 Public method to retrieve the modules name.
876 </p>
877 <dl>
878 <dt>Return:</dt>
879 <dd>
880 module name (string)
881 </dd>
882 </dl>
883 <a NAME="Module.getType" ID="Module.getType"></a>
884 <h4>Module.getType</h4>
885 <b>getType</b>(<i></i>)
886
887 <p>
888 Public method to get the type of the module's source.
889 </p>
890 <dl>
891 <dt>Return:</dt>
892 <dd>
893 type of the modules's source (string)
894 </dd>
895 </dl>
896 <a NAME="Module.scan" ID="Module.scan"></a>
897 <h4>Module.scan</h4>
898 <b>scan</b>(<i>src</i>)
899
900 <p>
901 Public method to scan the source text and retrieve the relevant
902 information.
903 </p>
904 <dl>
905
906 <dt><i>src</i></dt>
907 <dd>
908 the source text to be scanned (string)
909 </dd>
910 </dl>
911 <div align="right"><a href="#top">Up</a></div>
912 <hr />
913 <hr />
914 <a NAME="RbModule" ID="RbModule"></a>
915 <h2>RbModule</h2>
916
917 <p>
918 Class to represent a Ruby module.
919 </p>
920 <h3>Derived from</h3>
921 Class
922 <h3>Class Attributes</h3>
923
924 <table>
925 <tr><td>None</td></tr>
926 </table>
927 <h3>Class Methods</h3>
928
929 <table>
930 <tr><td>None</td></tr>
931 </table>
932 <h3>Methods</h3>
933
934 <table>
935
936 <tr>
937 <td><a href="#RbModule.__init__">RbModule</a></td>
938 <td>Constructor</td>
939 </tr>
940 <tr>
941 <td><a href="#RbModule.addClass">addClass</a></td>
942 <td>Public method to add information about a class.</td>
943 </tr>
944 </table>
945 <h3>Static Methods</h3>
946
947 <table>
948 <tr><td>None</td></tr>
949 </table>
950
951 <a NAME="RbModule.__init__" ID="RbModule.__init__"></a>
952 <h4>RbModule (Constructor)</h4>
953 <b>RbModule</b>(<i>module, name, file, lineno</i>)
954
955 <p>
956 Constructor
957 </p>
958 <dl>
959
960 <dt><i>module</i></dt>
961 <dd>
962 name of module containing this class (string)
963 </dd>
964 <dt><i>name</i></dt>
965 <dd>
966 name of the class (string)
967 </dd>
968 <dt><i>file</i></dt>
969 <dd>
970 name of file containing this class (string)
971 </dd>
972 <dt><i>lineno</i></dt>
973 <dd>
974 linenumber of the class definition (integer)
975 </dd>
976 </dl>
977 <a NAME="RbModule.addClass" ID="RbModule.addClass"></a>
978 <h4>RbModule.addClass</h4>
979 <b>addClass</b>(<i>name, _class</i>)
980
981 <p>
982 Public method to add information about a class.
983 </p>
984 <dl>
985
986 <dt><i>name</i></dt>
987 <dd>
988 name of class to be added (string)
989 </dd>
990 <dt><i>_class</i></dt>
991 <dd>
992 Class object to be added
993 </dd>
994 </dl>
995 <div align="right"><a href="#top">Up</a></div>
996 <hr />
997 <hr />
998 <a NAME="VisibilityBase" ID="VisibilityBase"></a>
999 <h2>VisibilityBase</h2>
1000
1001 <p>
1002 Class implementing the visibility aspect of all objects.
1003 </p>
1004 <h3>Derived from</h3>
1005 None
1006 <h3>Class Attributes</h3>
1007
1008 <table>
1009 <tr><td>None</td></tr>
1010 </table>
1011 <h3>Class Methods</h3>
1012
1013 <table>
1014 <tr><td>None</td></tr>
1015 </table>
1016 <h3>Methods</h3>
1017
1018 <table>
1019
1020 <tr>
1021 <td><a href="#VisibilityBase.isPrivate">isPrivate</a></td>
1022 <td>Public method to check, if the visibility is Private.</td>
1023 </tr>
1024 <tr>
1025 <td><a href="#VisibilityBase.isProtected">isProtected</a></td>
1026 <td>Public method to check, if the visibility is Protected.</td>
1027 </tr>
1028 <tr>
1029 <td><a href="#VisibilityBase.isPublic">isPublic</a></td>
1030 <td>Public method to check, if the visibility is Public.</td>
1031 </tr>
1032 <tr>
1033 <td><a href="#VisibilityBase.setPrivate">setPrivate</a></td>
1034 <td>Public method to set the visibility to Private.</td>
1035 </tr>
1036 <tr>
1037 <td><a href="#VisibilityBase.setProtected">setProtected</a></td>
1038 <td>Public method to set the visibility to Protected.</td>
1039 </tr>
1040 <tr>
1041 <td><a href="#VisibilityBase.setPublic">setPublic</a></td>
1042 <td>Public method to set the visibility to Public.</td>
1043 </tr>
1044 </table>
1045 <h3>Static Methods</h3>
1046
1047 <table>
1048 <tr><td>None</td></tr>
1049 </table>
1050
1051 <a NAME="VisibilityBase.isPrivate" ID="VisibilityBase.isPrivate"></a>
1052 <h4>VisibilityBase.isPrivate</h4>
1053 <b>isPrivate</b>(<i></i>)
1054
1055 <p>
1056 Public method to check, if the visibility is Private.
1057 </p>
1058 <dl>
1059 <dt>Return:</dt>
1060 <dd>
1061 flag indicating Private visibility (boolean)
1062 </dd>
1063 </dl>
1064 <a NAME="VisibilityBase.isProtected" ID="VisibilityBase.isProtected"></a>
1065 <h4>VisibilityBase.isProtected</h4>
1066 <b>isProtected</b>(<i></i>)
1067
1068 <p>
1069 Public method to check, if the visibility is Protected.
1070 </p>
1071 <dl>
1072 <dt>Return:</dt>
1073 <dd>
1074 flag indicating Protected visibility (boolean)
1075 </dd>
1076 </dl>
1077 <a NAME="VisibilityBase.isPublic" ID="VisibilityBase.isPublic"></a>
1078 <h4>VisibilityBase.isPublic</h4>
1079 <b>isPublic</b>(<i></i>)
1080
1081 <p>
1082 Public method to check, if the visibility is Public.
1083 </p>
1084 <dl>
1085 <dt>Return:</dt>
1086 <dd>
1087 flag indicating Public visibility (boolean)
1088 </dd>
1089 </dl>
1090 <a NAME="VisibilityBase.setPrivate" ID="VisibilityBase.setPrivate"></a>
1091 <h4>VisibilityBase.setPrivate</h4>
1092 <b>setPrivate</b>(<i></i>)
1093
1094 <p>
1095 Public method to set the visibility to Private.
1096 </p>
1097 <a NAME="VisibilityBase.setProtected" ID="VisibilityBase.setProtected"></a>
1098 <h4>VisibilityBase.setProtected</h4>
1099 <b>setProtected</b>(<i></i>)
1100
1101 <p>
1102 Public method to set the visibility to Protected.
1103 </p>
1104 <a NAME="VisibilityBase.setPublic" ID="VisibilityBase.setPublic"></a>
1105 <h4>VisibilityBase.setPublic</h4>
1106 <b>setPublic</b>(<i></i>)
1107
1108 <p>
1109 Public method to set the visibility to Public.
1110 </p>
1111 <div align="right"><a href="#top">Up</a></div>
1112 <hr />
1113 <hr />
1114 <a NAME="_indent" ID="_indent"></a>
1115 <h2>_indent</h2>
1116 <b>_indent</b>(<i>ws</i>)
1117
1118 <p>
1119 Protected function to determine the indent width of a whitespace string.
1120 </p>
1121 <dl>
1122
1123 <dt><i>ws</i></dt>
1124 <dd>
1125 The whitespace string to be cheked. (string)
1126 </dd>
1127 </dl>
1128 <dl>
1129 <dt>Return:</dt>
1130 <dd>
1131 Length of the whitespace string after tab expansion.
1132 </dd>
1133 </dl>
1134 <div align="right"><a href="#top">Up</a></div>
1135 <hr />
1136 <hr />
1137 <a NAME="find_module" ID="find_module"></a>
1138 <h2>find_module</h2>
1139 <b>find_module</b>(<i>name, path, extensions</i>)
1140
1141 <p>
1142 Module function to extend the Python module finding mechanism.
1143 </p>
1144 <p>
1145 This function searches for files in the given path. If the filename
1146 doesn't have an extension or an extension of .py, the normal search
1147 implemented in the imp module is used. For all other supported files
1148 only path is searched.
1149 </p>
1150 <dl>
1151
1152 <dt><i>name</i></dt>
1153 <dd>
1154 filename or modulename to search for (string)
1155 </dd>
1156 <dt><i>path</i></dt>
1157 <dd>
1158 search path (list of strings)
1159 </dd>
1160 <dt><i>extensions</i></dt>
1161 <dd>
1162 list of extensions, which should be considered valid
1163 source file extensions (list of strings)
1164 </dd>
1165 </dl>
1166 <dl>
1167 <dt>Return:</dt>
1168 <dd>
1169 tuple of the open file, pathname and description. Description
1170 is a tuple of file suffix, file mode and file type)
1171 </dd>
1172 </dl>
1173 <dl>
1174
1175 <dt>Raises <b>ImportError</b>:</dt>
1176 <dd>
1177 The file or module wasn't found.
1178 </dd>
1179 </dl>
1180 <div align="right"><a href="#top">Up</a></div>
1181 <hr />
1182 <hr />
1183 <a NAME="getTypeFromTypeName" ID="getTypeFromTypeName"></a>
1184 <h2>getTypeFromTypeName</h2>
1185 <b>getTypeFromTypeName</b>(<i>name</i>)
1186
1187 <p>
1188 Module function to determine the module type given the module type name.
1189 </p>
1190 <dl>
1191
1192 <dt><i>name</i></dt>
1193 <dd>
1194 module type name (string)
1195 </dd>
1196 </dl>
1197 <dl>
1198 <dt>Return:</dt>
1199 <dd>
1200 module type or -1 for failure (integer)
1201 </dd>
1202 </dl>
1203 <div align="right"><a href="#top">Up</a></div>
1204 <hr />
1205 <hr />
1206 <a NAME="readModule" ID="readModule"></a>
1207 <h2>readModule</h2>
1208 <b>readModule</b>(<i>module, path=None, inpackage=False, basename="", extensions=None, caching=True, ignoreBuiltinModules=False</i>)
1209
1210 <p>
1211 Function to read a module file and parse it.
1212 </p>
1213 <p>
1214 The module is searched in path and sys.path, read and parsed.
1215 If the module was parsed before, the information is taken
1216 from a cache in order to speed up processing.
1217 </p>
1218 <dl>
1219
1220 <dt><i>module</i></dt>
1221 <dd>
1222 name of the module to be parsed (string)
1223 </dd>
1224 <dt><i>path</i></dt>
1225 <dd>
1226 search path for the module (list of strings)
1227 </dd>
1228 <dt><i>inpackage</i></dt>
1229 <dd>
1230 flag indicating that module is inside a
1231 package (boolean)
1232 </dd>
1233 <dt><i>basename</i></dt>
1234 <dd>
1235 a path basename that is deleted from the filename of
1236 the module file to be read (string)
1237 </dd>
1238 <dt><i>extensions</i></dt>
1239 <dd>
1240 list of extensions, which should be considered valid
1241 source file extensions (list of strings)
1242 </dd>
1243 <dt><i>caching</i></dt>
1244 <dd>
1245 flag indicating that the parsed module should be
1246 cached (boolean)
1247 </dd>
1248 <dt><i>ignoreBuiltinModules</i></dt>
1249 <dd>
1250 flag indicating to ignore the builtin modules
1251 (boolean)
1252 </dd>
1253 </dl>
1254 <dl>
1255 <dt>Return:</dt>
1256 <dd>
1257 reference to a Module object containing the parsed
1258 module information (Module)
1259 </dd>
1260 </dl>
1261 <div align="right"><a href="#top">Up</a></div>
1262 <hr />
1263 <hr />
1264 <a NAME="resetParsedModule" ID="resetParsedModule"></a>
1265 <h2>resetParsedModule</h2>
1266 <b>resetParsedModule</b>(<i>module, basename=""</i>)
1267
1268 <p>
1269 Module function to clear one module from the list of parsed modules.
1270 </p>
1271 <dl>
1272
1273 <dt><i>module</i></dt>
1274 <dd>
1275 Name of the module to be parsed (string)
1276 </dd>
1277 <dt><i>basename</i></dt>
1278 <dd>
1279 a path basename. This basename is deleted from
1280 the filename of the module file to be cleared. (string)
1281 </dd>
1282 </dl>
1283 <div align="right"><a href="#top">Up</a></div>
1284 <hr />
1285 <hr />
1286 <a NAME="resetParsedModules" ID="resetParsedModules"></a>
1287 <h2>resetParsedModules</h2>
1288 <b>resetParsedModules</b>(<i></i>)
1289
1290 <p>
1291 Module function to reset the list of modules already parsed.
1292 </p>
1293 <div align="right"><a href="#top">Up</a></div>
1294 <hr />
1295 </body></html>

eric ide

mercurial