139 </table> |
139 </table> |
140 <h3>Methods</h3> |
140 <h3>Methods</h3> |
141 <table> |
141 <table> |
142 <tr> |
142 <tr> |
143 <td><a href="#Completer.__init__">Completer</a></td> |
143 <td><a href="#Completer.__init__">Completer</a></td> |
144 <td>Create a new completer for the command line.</td> |
144 <td>Constructor</td> |
145 </tr><tr> |
145 </tr><tr> |
146 <td><a href="#Completer.attr_matches">attr_matches</a></td> |
146 <td><a href="#Completer.attr_matches">attr_matches</a></td> |
147 <td>Compute matches when text contains a dot.</td> |
147 <td>Public method to compute matches when text contains a dot.</td> |
148 </tr><tr> |
148 </tr><tr> |
149 <td><a href="#Completer.complete">complete</a></td> |
149 <td><a href="#Completer.complete">complete</a></td> |
150 <td>Return the next possible completion for 'text'.</td> |
150 <td>Public method to return the next possible completion for 'text'.</td> |
151 </tr><tr> |
151 </tr><tr> |
152 <td><a href="#Completer.global_matches">global_matches</a></td> |
152 <td><a href="#Completer.global_matches">global_matches</a></td> |
153 <td>Compute matches when text is a simple name.</td> |
153 <td>Public method to compute matches when text is a simple name.</td> |
154 </tr> |
154 </tr> |
155 </table> |
155 </table> |
156 <h3>Static Methods</h3> |
156 <h3>Static Methods</h3> |
157 <table> |
157 <table> |
158 <tr><td>None</td></tr> |
158 <tr><td>None</td></tr> |
159 </table> |
159 </table> |
160 <a NAME="Completer.__init__" ID="Completer.__init__"></a> |
160 <a NAME="Completer.__init__" ID="Completer.__init__"></a> |
161 <h4>Completer (Constructor)</h4> |
161 <h4>Completer (Constructor)</h4> |
162 <b>Completer</b>(<i>namespace=None</i>) |
162 <b>Completer</b>(<i>namespace=None</i>) |
163 <p> |
163 <p> |
164 Create a new completer for the command line. |
164 Constructor |
165 </p><p> |
165 </p><p> |
166 Completer([namespace]) -> completer instance. |
166 Completer([namespace]) -> completer instance. |
167 </p><p> |
167 </p><p> |
168 If unspecified, the default namespace where completions are performed |
168 If unspecified, the default namespace where completions are performed |
169 is __main__ (technically, __main__.__dict__). Namespaces should be |
169 is __main__ (technically, __main__.__dict__). Namespaces should be |
185 </dd> |
185 </dd> |
186 </dl><a NAME="Completer.attr_matches" ID="Completer.attr_matches"></a> |
186 </dl><a NAME="Completer.attr_matches" ID="Completer.attr_matches"></a> |
187 <h4>Completer.attr_matches</h4> |
187 <h4>Completer.attr_matches</h4> |
188 <b>attr_matches</b>(<i>text</i>) |
188 <b>attr_matches</b>(<i>text</i>) |
189 <p> |
189 <p> |
190 Compute matches when text contains a dot. |
190 Public method to compute matches when text contains a dot. |
191 </p><p> |
191 </p><p> |
192 Assuming the text is of the form NAME.NAME....[NAME], and is |
192 Assuming the text is of the form NAME.NAME....[NAME], and is |
193 evaluatable in self.namespace, it will be evaluated and its attributes |
193 evaluatable in self.namespace, it will be evaluated and its attributes |
194 (as revealed by dir()) are used as possible completions. (For class |
194 (as revealed by dir()) are used as possible completions. (For class |
195 instances, class members are are also considered.) |
195 instances, class members are are also considered.) |
208 </dd> |
208 </dd> |
209 </dl><a NAME="Completer.complete" ID="Completer.complete"></a> |
209 </dl><a NAME="Completer.complete" ID="Completer.complete"></a> |
210 <h4>Completer.complete</h4> |
210 <h4>Completer.complete</h4> |
211 <b>complete</b>(<i>text, state</i>) |
211 <b>complete</b>(<i>text, state</i>) |
212 <p> |
212 <p> |
213 Return the next possible completion for 'text'. |
213 Public method to return the next possible completion for 'text'. |
214 </p><p> |
214 </p><p> |
215 This is called successively with state == 0, 1, 2, ... until it |
215 This is called successively with state == 0, 1, 2, ... until it |
216 returns None. The completion should begin with 'text'. |
216 returns None. The completion should begin with 'text'. |
217 </p><dl> |
217 </p><dl> |
218 <dt><i>text</i></dt> |
218 <dt><i>text</i></dt> |
229 </dd> |
229 </dd> |
230 </dl><a NAME="Completer.global_matches" ID="Completer.global_matches"></a> |
230 </dl><a NAME="Completer.global_matches" ID="Completer.global_matches"></a> |
231 <h4>Completer.global_matches</h4> |
231 <h4>Completer.global_matches</h4> |
232 <b>global_matches</b>(<i>text</i>) |
232 <b>global_matches</b>(<i>text</i>) |
233 <p> |
233 <p> |
234 Compute matches when text is a simple name. |
234 Public method to compute matches when text is a simple name. |
235 </p><dl> |
235 </p><dl> |
236 <dt><i>text</i></dt> |
236 <dt><i>text</i></dt> |
237 <dd> |
237 <dd> |
238 The text to be completed. (string) |
238 The text to be completed. (string) |
239 </dd> |
239 </dd> |