Documentation/Source/eric5.DebugClients.Python3.FlexCompleter.html

changeset 58
37f0444c3479
parent 21
b88a0e6268bd
child 409
0ea528e80202
equal deleted inserted replaced
57:81326a94fdca 58:37f0444c3479
20 </style> 20 </style>
21 </head> 21 </head>
22 <body><a NAME="top" ID="top"></a> 22 <body><a NAME="top" ID="top"></a>
23 <h1>eric5.DebugClients.Python3.FlexCompleter</h1> 23 <h1>eric5.DebugClients.Python3.FlexCompleter</h1>
24 <p> 24 <p>
25 &#87;&#111;&#114;&#100; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110; &#102;&#111;&#114; &#116;&#104;&#101; &#101;&#114;&#105;&#99;&#53; &#115;&#104;&#101;&#108;&#108; 25 Word completion for the eric5 shell
26 </p><p> 26 </p><p>
27 &#60;&#104;&#52;&#62;&#78;&#79;&#84;&#69; &#102;&#111;&#114; &#101;&#114;&#105;&#99;&#53; v&#97;&#114;&#105;&#97;&#110;&#116;&#60;/&#104;&#52;&#62; 27 <h4>NOTE for eric5 variant</h4>
28 </p><p> 28 </p><p>
29 &#84;&#104;&#105;&#115; v&#101;&#114;&#115;&#105;&#111;&#110; &#105;&#115; &#97; &#114;&#101;-&#105;&#109;&#112;&#108;&#101;&#109;&#101;&#110;&#116;&#97;&#116;&#105;&#111;&#110; &#111;&#102; &#114;&#108;&#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; 29 This version is a re-implementation of rlcompleter
30 &#97;&#115; &#102;&#111;&#117;&#110;&#100; &#105;&#110; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110;&#51; &#108;&#105;&#98;&#114;&#97;&#114;y. &#73;&#116; &#105;&#115; &#109;&#111;&#100;&#105;&#102;&#105;&#101;&#100; &#116;&#111; w&#111;&#114;&#107; w&#105;&#116;&#104; &#116;&#104;&#101; &#101;&#114;&#105;&#99;&#53; 30 as found in the Python3 library. It is modified to work with the eric5
31 &#100;&#101;&#98;&#117;&#103; &#99;&#108;&#105;&#101;&#110;&#116;&#115;. 31 debug clients.
32 </p><p> 32 </p><p>
33 &#60;&#104;&#52;&#62;&#79;&#114;&#105;&#103;&#105;&#110;&#97;&#108; &#114;&#108;&#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; &#100;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#97;&#116;&#105;&#111;&#110;&#60;/&#104;&#52;&#62; 33 <h4>Original rlcompleter documentation</h4>
34 </p><p> 34 </p><p>
35 &#84;&#104;&#105;&#115; &#114;&#101;&#113;&#117;&#105;&#114;&#101;&#115; &#116;&#104;&#101; &#108;&#97;&#116;&#101;&#115;&#116; &#101;x&#116;&#101;&#110;&#115;&#105;&#111;&#110; &#116;&#111; &#116;&#104;&#101; &#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101; &#109;&#111;&#100;&#117;&#108;&#101;. &#84;&#104;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; 35 This requires the latest extension to the readline module. The completer
36 &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#115; &#107;&#101;yw&#111;&#114;&#100;&#115;, &#98;&#117;&#105;&#108;&#116;-&#105;&#110;&#115; &#97;&#110;&#100; &#103;&#108;&#111;&#98;&#97;&#108;&#115; &#105;&#110; &#97; &#115;&#101;&#108;&#101;&#99;&#116;&#97;&#98;&#108;&#101; &#110;&#97;&#109;&#101;&#115;&#112;&#97;&#99;&#101; (w&#104;&#105;&#99;&#104; 36 completes keywords, built-ins and globals in a selectable namespace (which
37 &#100;&#101;&#102;&#97;&#117;&#108;&#116;&#115; &#116;&#111; &#95;&#95;&#109;&#97;&#105;&#110;&#95;&#95;)&#59; w&#104;&#101;&#110; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#110;&#103; &#78;&#65;&#77;&#69;.&#78;&#65;&#77;&#69;..., &#105;&#116; &#101;v&#97;&#108;&#117;&#97;&#116;&#101;&#115; (!) &#116;&#104;&#101; 37 defaults to __main__); when completing NAME.NAME..., it evaluates (!) the
38 &#101;x&#112;&#114;&#101;&#115;&#115;&#105;&#111;&#110; &#117;&#112; &#116;&#111; &#116;&#104;&#101; &#108;&#97;&#115;&#116; &#100;&#111;&#116; &#97;&#110;&#100; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#115; &#105;&#116;&#115; &#97;&#116;&#116;&#114;&#105;&#98;&#117;&#116;&#101;&#115;. 38 expression up to the last dot and completes its attributes.
39 </p><p> 39 </p><p>
40 &#73;&#116;'&#115; v&#101;&#114;y &#99;&#111;&#111;&#108; &#116;&#111; &#100;&#111; "&#105;&#109;&#112;&#111;&#114;&#116; &#115;y&#115;" &#116;y&#112;&#101; "&#115;y&#115;.", &#104;&#105;&#116; &#116;&#104;&#101; 40 It's very cool to do "import sys" type "sys.", hit the
41 &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110; &#107;&#101;y (&#116;w&#105;&#99;&#101;), &#97;&#110;&#100; &#115;&#101;&#101; &#116;&#104;&#101; &#108;&#105;&#115;&#116; &#111;&#102; &#110;&#97;&#109;&#101;&#115; &#100;&#101;&#102;&#105;&#110;&#101;&#100; &#98;y &#116;&#104;&#101; 41 completion key (twice), and see the list of names defined by the
42 &#115;y&#115; &#109;&#111;&#100;&#117;&#108;&#101;! 42 sys module!
43 </p><p> 43 </p><p>
44 &#84;&#105;&#112;&#58; &#116;&#111; &#117;&#115;&#101; &#116;&#104;&#101; &#116;&#97;&#98; &#107;&#101;y &#97;&#115; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110; &#107;&#101;y, &#99;&#97;&#108;&#108; 44 Tip: to use the tab key as the completion key, call
45 </p><p> 45 </p><p>
46 &#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101;.&#112;&#97;&#114;&#115;&#101;&#95;&#97;&#110;&#100;&#95;&#98;&#105;&#110;&#100;("&#116;&#97;&#98;&#58; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;") 46 readline.parse_and_bind("tab: complete")
47 </p><p> 47 </p><p>
48 &#60;&#98;&#62;&#78;&#111;&#116;&#101;&#115;&#60;/&#98;&#62;&#58; 48 <b>Notes</b>:
49 &#60;&#117;&#108;&#62; 49 <ul>
50 &#60;&#108;&#105;&#62; 50 <li>
51 &#69;x&#99;&#101;&#112;&#116;&#105;&#111;&#110;&#115; &#114;&#97;&#105;&#115;&#101;&#100; &#98;y &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#97;&#114;&#101; *&#105;&#103;&#110;&#111;&#114;&#101;&#100;* (&#97;&#110;&#100; 51 Exceptions raised by the completer function are *ignored* (and
52 &#103;&#101;&#110;&#101;&#114;&#97;&#108;&#108;y &#99;&#97;&#117;&#115;&#101; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110; &#116;&#111; &#102;&#97;&#105;&#108;). &#84;&#104;&#105;&#115; &#105;&#115; &#97; &#102;&#101;&#97;&#116;&#117;&#114;&#101; -- &#115;&#105;&#110;&#99;&#101; 52 generally cause the completion to fail). This is a feature -- since
53 &#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101; &#115;&#101;&#116;&#115; &#116;&#104;&#101; &#116;&#116;y &#100;&#101;v&#105;&#99;&#101; &#105;&#110; &#114;&#97;w (&#111;&#114; &#99;&#98;&#114;&#101;&#97;&#107;) &#109;&#111;&#100;&#101;, &#112;&#114;&#105;&#110;&#116;&#105;&#110;&#103; &#97; 53 readline sets the tty device in raw (or cbreak) mode, printing a
54 &#116;&#114;&#97;&#99;&#101;&#98;&#97;&#99;&#107; w&#111;&#117;&#108;&#100;&#110;'&#116; w&#111;&#114;&#107; w&#101;&#108;&#108; w&#105;&#116;&#104;&#111;&#117;&#116; &#115;&#111;&#109;&#101; &#99;&#111;&#109;&#112;&#108;&#105;&#99;&#97;&#116;&#101;&#100; &#104;&#111;&#111;&#112;&#108;&#97; &#116;&#111; &#115;&#97;v&#101;, 54 traceback wouldn't work well without some complicated hoopla to save,
55 &#114;&#101;&#115;&#101;&#116; &#97;&#110;&#100; &#114;&#101;&#115;&#116;&#111;&#114;&#101; &#116;&#104;&#101; &#116;&#116;y &#115;&#116;&#97;&#116;&#101;. 55 reset and restore the tty state.
56 &#60;/&#108;&#105;&#62; 56 </li>
57 &#60;&#108;&#105;&#62; 57 <li>
58 &#84;&#104;&#101; &#101;v&#97;&#108;&#117;&#97;&#116;&#105;&#111;&#110; &#111;&#102; &#116;&#104;&#101; &#78;&#65;&#77;&#69;.&#78;&#65;&#77;&#69;... &#102;&#111;&#114;&#109; &#109;&#97;y &#99;&#97;&#117;&#115;&#101; &#97;&#114;&#98;&#105;&#116;&#114;&#97;&#114;y 58 The evaluation of the NAME.NAME... form may cause arbitrary
59 &#97;&#112;&#112;&#108;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#100;&#101;&#102;&#105;&#110;&#101;&#100; &#99;&#111;&#100;&#101; &#116;&#111; &#98;&#101; &#101;x&#101;&#99;&#117;&#116;&#101;&#100; &#105;&#102; &#97;&#110; &#111;&#98;&#106;&#101;&#99;&#116; w&#105;&#116;&#104; &#97; 59 application defined code to be executed if an object with a
60 &#95;&#95;&#103;&#101;&#116;&#97;&#116;&#116;&#114;&#95;&#95; &#104;&#111;&#111;&#107; &#105;&#115; &#102;&#111;&#117;&#110;&#100;. &#83;&#105;&#110;&#99;&#101; &#105;&#116; &#105;&#115; &#116;&#104;&#101; &#114;&#101;&#115;&#112;&#111;&#110;&#115;&#105;&#98;&#105;&#108;&#105;&#116;y &#111;&#102; &#116;&#104;&#101; 60 __getattr__ hook is found. Since it is the responsibility of the
61 &#97;&#112;&#112;&#108;&#105;&#99;&#97;&#116;&#105;&#111;&#110; (&#111;&#114; &#116;&#104;&#101; &#117;&#115;&#101;&#114;) &#116;&#111; &#101;&#110;&#97;&#98;&#108;&#101; &#116;&#104;&#105;&#115; &#102;&#101;&#97;&#116;&#117;&#114;&#101;, &#73; &#99;&#111;&#110;&#115;&#105;&#100;&#101;&#114; &#116;&#104;&#105;&#115; &#97;&#110; 61 application (or the user) to enable this feature, I consider this an
62 &#97;&#99;&#99;&#101;&#112;&#116;&#97;&#98;&#108;&#101; &#114;&#105;&#115;&#107;. &#77;&#111;&#114;&#101; &#99;&#111;&#109;&#112;&#108;&#105;&#99;&#97;&#116;&#101;&#100; &#101;x&#112;&#114;&#101;&#115;&#115;&#105;&#111;&#110;&#115; (&#101;.&#103;. &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#99;&#97;&#108;&#108;&#115; &#111;&#114; 62 acceptable risk. More complicated expressions (e.g. function calls or
63 &#105;&#110;&#100;&#101;x&#105;&#110;&#103; &#111;&#112;&#101;&#114;&#97;&#116;&#105;&#111;&#110;&#115;) &#97;&#114;&#101; *&#110;&#111;&#116;* &#101;v&#97;&#108;&#117;&#97;&#116;&#101;&#100;. 63 indexing operations) are *not* evaluated.
64 &#60;/&#108;&#105;&#62; 64 </li>
65 &#60;&#108;&#105;&#62; 65 <li>
66 &#87;&#104;&#101;&#110; &#116;&#104;&#101; &#111;&#114;&#105;&#103;&#105;&#110;&#97;&#108; &#115;&#116;&#100;&#105;&#110; &#105;&#115; &#110;&#111;&#116; &#97; &#116;&#116;y &#100;&#101;v&#105;&#99;&#101;, &#71;&#78;&#85; &#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101; &#105;&#115; &#110;&#101;v&#101;&#114; 66 When the original stdin is not a tty device, GNU readline is never
67 &#117;&#115;&#101;&#100;, &#97;&#110;&#100; &#116;&#104;&#105;&#115; &#109;&#111;&#100;&#117;&#108;&#101; (&#97;&#110;&#100; &#116;&#104;&#101; &#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101; &#109;&#111;&#100;&#117;&#108;&#101;) &#97;&#114;&#101; &#115;&#105;&#108;&#101;&#110;&#116;&#108;y &#105;&#110;&#97;&#99;&#116;&#105;v&#101;. 67 used, and this module (and the readline module) are silently inactive.
68 &#60;/&#108;&#105;&#62; 68 </li>
69 &#60;/&#117;&#108;&#62; 69 </ul>
70 </p> 70 </p>
71 <h3>Global Attributes</h3> 71 <h3>Global Attributes</h3>
72 <table> 72 <table>
73 <tr><td>__all__</td></tr> 73 <tr><td>__all__</td></tr>
74 </table> 74 </table>
75 <h3>Classes</h3> 75 <h3>Classes</h3>
76 <table> 76 <table>
77 <tr> 77 <tr>
78 <td><a href="#Completer">Completer</a></td> 78 <td><a href="#Completer">Completer</a></td>
79 <td>&#67;&#108;&#97;&#115;&#115; &#105;&#109;&#112;&#108;&#101;&#109;&#101;&#110;&#116;&#105;&#110;&#103; &#116;&#104;&#101; &#99;&#111;&#109;&#109;&#97;&#110;&#100; &#108;&#105;&#110;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; &#111;&#98;&#106;&#101;&#99;&#116;.</td> 79 <td>Class implementing the command line completer object.</td>
80 </tr> 80 </tr>
81 </table> 81 </table>
82 <h3>Functions</h3> 82 <h3>Functions</h3>
83 <table> 83 <table>
84 <tr> 84 <tr>
85 <td><a href="#get_class_members">get_class_members</a></td> 85 <td><a href="#get_class_members">get_class_members</a></td>
86 <td>&#77;&#111;&#100;&#117;&#108;&#101; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#114;&#101;&#116;&#114;&#105;&#101;v&#101; &#116;&#104;&#101; &#99;&#108;&#97;&#115;&#115; &#109;&#101;&#109;&#98;&#101;&#114;&#115;.</td> 86 <td>Module function to retrieve the class members.</td>
87 </tr> 87 </tr>
88 </table> 88 </table>
89 <hr /><hr /> 89 <hr /><hr />
90 <a NAME="Completer" ID="Completer"></a> 90 <a NAME="Completer" ID="Completer"></a>
91 <h2>Completer</h2> 91 <h2>Completer</h2>
92 <p> 92 <p>
93 &#67;&#108;&#97;&#115;&#115; &#105;&#109;&#112;&#108;&#101;&#109;&#101;&#110;&#116;&#105;&#110;&#103; &#116;&#104;&#101; &#99;&#111;&#109;&#109;&#97;&#110;&#100; &#108;&#105;&#110;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; &#111;&#98;&#106;&#101;&#99;&#116;. 93 Class implementing the command line completer object.
94 </p> 94 </p>
95 <h3>Derived from</h3> 95 <h3>Derived from</h3>
96 object 96 object
97 <h3>Class Attributes</h3> 97 <h3>Class Attributes</h3>
98 <table> 98 <table>
100 </table> 100 </table>
101 <h3>Methods</h3> 101 <h3>Methods</h3>
102 <table> 102 <table>
103 <tr> 103 <tr>
104 <td><a href="#Completer.__init__">Completer</a></td> 104 <td><a href="#Completer.__init__">Completer</a></td>
105 <td>&#67;&#114;&#101;&#97;&#116;&#101; &#97; &#110;&#101;w &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#109;&#97;&#110;&#100; &#108;&#105;&#110;&#101;.</td> 105 <td>Create a new completer for the command line.</td>
106 </tr><tr> 106 </tr><tr>
107 <td><a href="#Completer._callable_postfix">_callable_postfix</a></td> 107 <td><a href="#Completer._callable_postfix">_callable_postfix</a></td>
108 <td>&#80;&#114;&#111;&#116;&#101;&#99;&#116;&#101;&#100; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#99;&#104;&#101;&#99;&#107; &#102;&#111;&#114; &#97; &#99;&#97;&#108;&#108;&#97;&#98;&#108;&#101;.</td> 108 <td>Protected method to check for a callable.</td>
109 </tr><tr> 109 </tr><tr>
110 <td><a href="#Completer.attr_matches">attr_matches</a></td> 110 <td><a href="#Completer.attr_matches">attr_matches</a></td>
111 <td>&#67;&#111;&#109;&#112;&#117;&#116;&#101; &#109;&#97;&#116;&#99;&#104;&#101;&#115; w&#104;&#101;&#110; &#116;&#101;x&#116; &#99;&#111;&#110;&#116;&#97;&#105;&#110;&#115; &#97; &#100;&#111;&#116;.</td> 111 <td>Compute matches when text contains a dot.</td>
112 </tr><tr> 112 </tr><tr>
113 <td><a href="#Completer.complete">complete</a></td> 113 <td><a href="#Completer.complete">complete</a></td>
114 <td>&#82;&#101;&#116;&#117;&#114;&#110; &#116;&#104;&#101; &#110;&#101;x&#116; &#112;&#111;&#115;&#115;&#105;&#98;&#108;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110; &#102;&#111;&#114; '&#116;&#101;x&#116;'.</td> 114 <td>Return the next possible completion for 'text'.</td>
115 </tr><tr> 115 </tr><tr>
116 <td><a href="#Completer.global_matches">global_matches</a></td> 116 <td><a href="#Completer.global_matches">global_matches</a></td>
117 <td>&#67;&#111;&#109;&#112;&#117;&#116;&#101; &#109;&#97;&#116;&#99;&#104;&#101;&#115; w&#104;&#101;&#110; &#116;&#101;x&#116; &#105;&#115; &#97; &#115;&#105;&#109;&#112;&#108;&#101; &#110;&#97;&#109;&#101;.</td> 117 <td>Compute matches when text is a simple name.</td>
118 </tr> 118 </tr>
119 </table> 119 </table>
120 <a NAME="Completer.__init__" ID="Completer.__init__"></a> 120 <a NAME="Completer.__init__" ID="Completer.__init__"></a>
121 <h4>Completer (Constructor)</h4> 121 <h4>Completer (Constructor)</h4>
122 <b>Completer</b>(<i>namespace = None</i>) 122 <b>Completer</b>(<i>namespace = None</i>)
123 <p> 123 <p>
124 &#67;&#114;&#101;&#97;&#116;&#101; &#97; &#110;&#101;w &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#109;&#97;&#110;&#100; &#108;&#105;&#110;&#101;. 124 Create a new completer for the command line.
125 </p><p> 125 </p><p>
126 &#67;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114;(&#91;&#110;&#97;&#109;&#101;&#115;&#112;&#97;&#99;&#101;&#93;) -&#62; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; &#105;&#110;&#115;&#116;&#97;&#110;&#99;&#101;. 126 Completer([namespace]) -> completer instance.
127 </p><p> 127 </p><p>
128 &#73;&#102; &#117;&#110;&#115;&#112;&#101;&#99;&#105;&#102;&#105;&#101;&#100;, &#116;&#104;&#101; &#100;&#101;&#102;&#97;&#117;&#108;&#116; &#110;&#97;&#109;&#101;&#115;&#112;&#97;&#99;&#101; w&#104;&#101;&#114;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110;&#115; &#97;&#114;&#101; &#112;&#101;&#114;&#102;&#111;&#114;&#109;&#101;&#100; 128 If unspecified, the default namespace where completions are performed
129 &#105;&#115; &#95;&#95;&#109;&#97;&#105;&#110;&#95;&#95; (&#116;&#101;&#99;&#104;&#110;&#105;&#99;&#97;&#108;&#108;y, &#95;&#95;&#109;&#97;&#105;&#110;&#95;&#95;.&#95;&#95;&#100;&#105;&#99;&#116;&#95;&#95;). &#78;&#97;&#109;&#101;&#115;&#112;&#97;&#99;&#101;&#115; &#115;&#104;&#111;&#117;&#108;&#100; &#98;&#101; 129 is __main__ (technically, __main__.__dict__). Namespaces should be
130 &#103;&#105;v&#101;&#110; &#97;&#115; &#100;&#105;&#99;&#116;&#105;&#111;&#110;&#97;&#114;&#105;&#101;&#115;. 130 given as dictionaries.
131 </p><p> 131 </p><p>
132 &#67;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114; &#105;&#110;&#115;&#116;&#97;&#110;&#99;&#101;&#115; &#115;&#104;&#111;&#117;&#108;&#100; &#98;&#101; &#117;&#115;&#101;&#100; &#97;&#115; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110; &#109;&#101;&#99;&#104;&#97;&#110;&#105;&#115;&#109; &#111;&#102; 132 Completer instances should be used as the completion mechanism of
133 &#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101; v&#105;&#97; &#116;&#104;&#101; &#115;&#101;&#116;&#95;&#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114;() &#99;&#97;&#108;&#108;&#58; 133 readline via the set_completer() call:
134 </p><p> 134 </p><p>
135 &#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101;.&#115;&#101;&#116;&#95;&#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114;(&#67;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114;(&#109;y&#95;&#110;&#97;&#109;&#101;&#115;&#112;&#97;&#99;&#101;).&#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;) 135 readline.set_completer(Completer(my_namespace).complete)
136 </p><dl> 136 </p><dl>
137 <dt><i>namespace</i></dt> 137 <dt><i>namespace</i></dt>
138 <dd> 138 <dd>
139 &#84;&#104;&#101; &#110;&#97;&#109;&#101;&#115;&#112;&#97;&#99;&#101; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#114;. 139 The namespace for the completer.
140 </dd> 140 </dd>
141 </dl><a NAME="Completer._callable_postfix" ID="Completer._callable_postfix"></a> 141 </dl><a NAME="Completer._callable_postfix" ID="Completer._callable_postfix"></a>
142 <h4>Completer._callable_postfix</h4> 142 <h4>Completer._callable_postfix</h4>
143 <b>_callable_postfix</b>(<i>val, word</i>) 143 <b>_callable_postfix</b>(<i>val, word</i>)
144 <p> 144 <p>
145 &#80;&#114;&#111;&#116;&#101;&#99;&#116;&#101;&#100; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#99;&#104;&#101;&#99;&#107; &#102;&#111;&#114; &#97; &#99;&#97;&#108;&#108;&#97;&#98;&#108;&#101;. 145 Protected method to check for a callable.
146 </p><dl> 146 </p><dl>
147 <dt><i>val</i></dt> 147 <dt><i>val</i></dt>
148 <dd> 148 <dd>
149 v&#97;&#108;&#117;&#101; &#116;&#111; &#99;&#104;&#101;&#99;&#107; (&#111;&#98;&#106;&#101;&#99;&#116;) 149 value to check (object)
150 </dd><dt><i>word</i></dt> 150 </dd><dt><i>word</i></dt>
151 <dd> 151 <dd>
152 w&#111;&#114;&#100; &#116;&#111; &#97;&#109;&#109;&#101;&#110;&#100; (&#115;&#116;&#114;&#105;&#110;&#103;) 152 word to ammend (string)
153 </dd> 153 </dd>
154 </dl><dl> 154 </dl><dl>
155 <dt>Returns:</dt> 155 <dt>Returns:</dt>
156 <dd> 156 <dd>
157 &#97;&#109;&#109;&#101;&#110;&#100;&#101;&#100; w&#111;&#114;&#100; (&#115;&#116;&#114;&#105;&#110;&#103;) 157 ammended word (string)
158 </dd> 158 </dd>
159 </dl><a NAME="Completer.attr_matches" ID="Completer.attr_matches"></a> 159 </dl><a NAME="Completer.attr_matches" ID="Completer.attr_matches"></a>
160 <h4>Completer.attr_matches</h4> 160 <h4>Completer.attr_matches</h4>
161 <b>attr_matches</b>(<i>text</i>) 161 <b>attr_matches</b>(<i>text</i>)
162 <p> 162 <p>
163 &#67;&#111;&#109;&#112;&#117;&#116;&#101; &#109;&#97;&#116;&#99;&#104;&#101;&#115; w&#104;&#101;&#110; &#116;&#101;x&#116; &#99;&#111;&#110;&#116;&#97;&#105;&#110;&#115; &#97; &#100;&#111;&#116;. 163 Compute matches when text contains a dot.
164 </p><p> 164 </p><p>
165 &#65;&#115;&#115;&#117;&#109;&#105;&#110;&#103; &#116;&#104;&#101; &#116;&#101;x&#116; &#105;&#115; &#111;&#102; &#116;&#104;&#101; &#102;&#111;&#114;&#109; &#78;&#65;&#77;&#69;.&#78;&#65;&#77;&#69;....&#91;&#78;&#65;&#77;&#69;&#93;, &#97;&#110;&#100; &#105;&#115; 165 Assuming the text is of the form NAME.NAME....[NAME], and is
166 &#101;v&#97;&#108;&#117;&#97;&#116;&#97;&#98;&#108;&#101; &#105;&#110; &#115;&#101;&#108;&#102;.&#110;&#97;&#109;&#101;&#115;&#112;&#97;&#99;&#101;, &#105;&#116; w&#105;&#108;&#108; &#98;&#101; &#101;v&#97;&#108;&#117;&#97;&#116;&#101;&#100; &#97;&#110;&#100; &#105;&#116;&#115; &#97;&#116;&#116;&#114;&#105;&#98;&#117;&#116;&#101;&#115; 166 evaluatable in self.namespace, it will be evaluated and its attributes
167 (&#97;&#115; &#114;&#101;v&#101;&#97;&#108;&#101;&#100; &#98;y &#100;&#105;&#114;()) &#97;&#114;&#101; &#117;&#115;&#101;&#100; &#97;&#115; &#112;&#111;&#115;&#115;&#105;&#98;&#108;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110;&#115;. (&#70;&#111;&#114; &#99;&#108;&#97;&#115;&#115; 167 (as revealed by dir()) are used as possible completions. (For class
168 &#105;&#110;&#115;&#116;&#97;&#110;&#99;&#101;&#115;, &#99;&#108;&#97;&#115;&#115; &#109;&#101;&#109;&#98;&#101;&#114;&#115; &#97;&#114;&#101; &#97;&#114;&#101; &#97;&#108;&#115;&#111; &#99;&#111;&#110;&#115;&#105;&#100;&#101;&#114;&#101;&#100;.) 168 instances, class members are are also considered.)
169 </p><p> 169 </p><p>
170 &#60;&#98;&#62;&#87;&#65;&#82;&#78;&#73;&#78;&#71;&#60;/&#98;&#62;&#58; &#116;&#104;&#105;&#115; &#99;&#97;&#110; &#115;&#116;&#105;&#108;&#108; &#105;&#110;v&#111;&#107;&#101; &#97;&#114;&#98;&#105;&#116;&#114;&#97;&#114;y &#67; &#99;&#111;&#100;&#101;, &#105;&#102; &#97;&#110; &#111;&#98;&#106;&#101;&#99;&#116; 170 <b>WARNING</b>: this can still invoke arbitrary C code, if an object
171 w&#105;&#116;&#104; &#97; &#95;&#95;&#103;&#101;&#116;&#97;&#116;&#116;&#114;&#95;&#95; &#104;&#111;&#111;&#107; &#105;&#115; &#101;v&#97;&#108;&#117;&#97;&#116;&#101;&#100;. 171 with a __getattr__ hook is evaluated.
172 </p><dl> 172 </p><dl>
173 <dt><i>text</i></dt> 173 <dt><i>text</i></dt>
174 <dd> 174 <dd>
175 &#84;&#104;&#101; &#116;&#101;x&#116; &#116;&#111; &#98;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#100;. (&#115;&#116;&#114;&#105;&#110;&#103;) 175 The text to be completed. (string)
176 </dd> 176 </dd>
177 </dl><dl> 177 </dl><dl>
178 <dt>Returns:</dt> 178 <dt>Returns:</dt>
179 <dd> 179 <dd>
180 &#65; &#108;&#105;&#115;&#116; &#111;&#102; &#97;&#108;&#108; &#109;&#97;&#116;&#99;&#104;&#101;&#115;. 180 A list of all matches.
181 </dd> 181 </dd>
182 </dl><a NAME="Completer.complete" ID="Completer.complete"></a> 182 </dl><a NAME="Completer.complete" ID="Completer.complete"></a>
183 <h4>Completer.complete</h4> 183 <h4>Completer.complete</h4>
184 <b>complete</b>(<i>text, state</i>) 184 <b>complete</b>(<i>text, state</i>)
185 <p> 185 <p>
186 &#82;&#101;&#116;&#117;&#114;&#110; &#116;&#104;&#101; &#110;&#101;x&#116; &#112;&#111;&#115;&#115;&#105;&#98;&#108;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110; &#102;&#111;&#114; '&#116;&#101;x&#116;'. 186 Return the next possible completion for 'text'.
187 </p><p> 187 </p><p>
188 &#84;&#104;&#105;&#115; &#105;&#115; &#99;&#97;&#108;&#108;&#101;&#100; &#115;&#117;&#99;&#99;&#101;&#115;&#115;&#105;v&#101;&#108;y w&#105;&#116;&#104; &#115;&#116;&#97;&#116;&#101; &#61;&#61; &#48;, &#49;, &#50;, ... &#117;&#110;&#116;&#105;&#108; &#105;&#116; 188 This is called successively with state == 0, 1, 2, ... until it
189 &#114;&#101;&#116;&#117;&#114;&#110;&#115; &#78;&#111;&#110;&#101;. &#84;&#104;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110; &#115;&#104;&#111;&#117;&#108;&#100; &#98;&#101;&#103;&#105;&#110; w&#105;&#116;&#104; '&#116;&#101;x&#116;'. 189 returns None. The completion should begin with 'text'.
190 </p><dl> 190 </p><dl>
191 <dt><i>text</i></dt> 191 <dt><i>text</i></dt>
192 <dd> 192 <dd>
193 &#84;&#104;&#101; &#116;&#101;x&#116; &#116;&#111; &#98;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#100;. (&#115;&#116;&#114;&#105;&#110;&#103;) 193 The text to be completed. (string)
194 </dd><dt><i>state</i></dt> 194 </dd><dt><i>state</i></dt>
195 <dd> 195 <dd>
196 &#84;&#104;&#101; &#115;&#116;&#97;&#116;&#101; &#111;&#102; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110;. (&#105;&#110;&#116;&#101;&#103;&#101;&#114;) 196 The state of the completion. (integer)
197 </dd> 197 </dd>
198 </dl><dl> 198 </dl><dl>
199 <dt>Returns:</dt> 199 <dt>Returns:</dt>
200 <dd> 200 <dd>
201 &#84;&#104;&#101; &#112;&#111;&#115;&#115;&#105;&#98;&#108;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#105;&#111;&#110;&#115; &#97;&#115; &#97; &#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;. 201 The possible completions as a list of strings.
202 </dd> 202 </dd>
203 </dl><a NAME="Completer.global_matches" ID="Completer.global_matches"></a> 203 </dl><a NAME="Completer.global_matches" ID="Completer.global_matches"></a>
204 <h4>Completer.global_matches</h4> 204 <h4>Completer.global_matches</h4>
205 <b>global_matches</b>(<i>text</i>) 205 <b>global_matches</b>(<i>text</i>)
206 <p> 206 <p>
207 &#67;&#111;&#109;&#112;&#117;&#116;&#101; &#109;&#97;&#116;&#99;&#104;&#101;&#115; w&#104;&#101;&#110; &#116;&#101;x&#116; &#105;&#115; &#97; &#115;&#105;&#109;&#112;&#108;&#101; &#110;&#97;&#109;&#101;. 207 Compute matches when text is a simple name.
208 </p><dl> 208 </p><dl>
209 <dt><i>text</i></dt> 209 <dt><i>text</i></dt>
210 <dd> 210 <dd>
211 &#84;&#104;&#101; &#116;&#101;x&#116; &#116;&#111; &#98;&#101; &#99;&#111;&#109;&#112;&#108;&#101;&#116;&#101;&#100;. (&#115;&#116;&#114;&#105;&#110;&#103;) 211 The text to be completed. (string)
212 </dd> 212 </dd>
213 </dl><dl> 213 </dl><dl>
214 <dt>Returns:</dt> 214 <dt>Returns:</dt>
215 <dd> 215 <dd>
216 &#65; &#108;&#105;&#115;&#116; &#111;&#102; &#97;&#108;&#108; &#107;&#101;yw&#111;&#114;&#100;&#115;, &#98;&#117;&#105;&#108;&#116;-&#105;&#110; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#115; &#97;&#110;&#100; &#110;&#97;&#109;&#101;&#115; &#99;&#117;&#114;&#114;&#101;&#110;&#116;&#108;y 216 A list of all keywords, built-in functions and names currently
217 &#100;&#101;&#102;&#105;&#110;&#101;&#100; &#105;&#110; &#115;&#101;&#108;&#102;.&#110;&#97;&#109;&#101;&#115;&#112;&#97;&#99;&#101; &#116;&#104;&#97;&#116; &#109;&#97;&#116;&#99;&#104;. 217 defined in self.namespace that match.
218 </dd> 218 </dd>
219 </dl> 219 </dl>
220 <div align="right"><a href="#top">Up</a></div> 220 <div align="right"><a href="#top">Up</a></div>
221 <hr /><hr /> 221 <hr /><hr />
222 <a NAME="get_class_members" ID="get_class_members"></a> 222 <a NAME="get_class_members" ID="get_class_members"></a>
223 <h2>get_class_members</h2> 223 <h2>get_class_members</h2>
224 <b>get_class_members</b>(<i>klass</i>) 224 <b>get_class_members</b>(<i>klass</i>)
225 <p> 225 <p>
226 &#77;&#111;&#100;&#117;&#108;&#101; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#114;&#101;&#116;&#114;&#105;&#101;v&#101; &#116;&#104;&#101; &#99;&#108;&#97;&#115;&#115; &#109;&#101;&#109;&#98;&#101;&#114;&#115;. 226 Module function to retrieve the class members.
227 </p><dl> 227 </p><dl>
228 <dt><i>klass</i></dt> 228 <dt><i>klass</i></dt>
229 <dd> 229 <dd>
230 &#84;&#104;&#101; &#99;&#108;&#97;&#115;&#115; &#111;&#98;&#106;&#101;&#99;&#116; &#116;&#111; &#98;&#101; &#97;&#110;&#97;&#108;y&#115;&#101;&#100;. 230 The class object to be analysed.
231 </dd> 231 </dd>
232 </dl><dl> 232 </dl><dl>
233 <dt>Returns:</dt> 233 <dt>Returns:</dt>
234 <dd> 234 <dd>
235 &#65; &#108;&#105;&#115;&#116; &#111;&#102; &#97;&#108;&#108; &#110;&#97;&#109;&#101;&#115; &#100;&#101;&#102;&#105;&#110;&#101;&#100; &#105;&#110; &#116;&#104;&#101; &#99;&#108;&#97;&#115;&#115;. 235 A list of all names defined in the class.
236 </dd> 236 </dd>
237 </dl> 237 </dl>
238 <div align="right"><a href="#top">Up</a></div> 238 <div align="right"><a href="#top">Up</a></div>
239 <hr /> 239 <hr />
240 </body></html> 240 </body></html>

eric ide

mercurial