|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.QScintilla.TypingCompleters.CompleterPython</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.QScintilla.TypingCompleters.CompleterPython</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing a typing completer for Python. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#CompleterPython">CompleterPython</a></td> |
|
39 <td>Class implementing typing completer for Python.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /> |
|
48 <hr /> |
|
49 <a NAME="CompleterPython" ID="CompleterPython"></a> |
|
50 <h2>CompleterPython</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing typing completer for Python. |
|
54 </p> |
|
55 <h3>Derived from</h3> |
|
56 CompleterBase |
|
57 <h3>Class Attributes</h3> |
|
58 |
|
59 <table> |
|
60 <tr><td>None</td></tr> |
|
61 </table> |
|
62 <h3>Class Methods</h3> |
|
63 |
|
64 <table> |
|
65 <tr><td>None</td></tr> |
|
66 </table> |
|
67 <h3>Methods</h3> |
|
68 |
|
69 <table> |
|
70 |
|
71 <tr> |
|
72 <td><a href="#CompleterPython.__init__">CompleterPython</a></td> |
|
73 <td>Constructor</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#CompleterPython.__dedentDefStatement">__dedentDefStatement</a></td> |
|
77 <td>Private method to dedent the line of the def statement to a previous def statement or class statement.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#CompleterPython.__dedentElseToIfWhileForTry">__dedentElseToIfWhileForTry</a></td> |
|
81 <td>Private method to dedent the line of the else statement to the last if, while, for or try statement with less (or equal) indentation.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#CompleterPython.__dedentExceptToTry">__dedentExceptToTry</a></td> |
|
85 <td>Private method to dedent the line of the except statement to the last try statement with less (or equal) indentation.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#CompleterPython.__dedentFinallyToTry">__dedentFinallyToTry</a></td> |
|
89 <td>Private method to dedent the line of the except statement to the last try statement with less (or equal) indentation.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#CompleterPython.__dedentToIf">__dedentToIf</a></td> |
|
93 <td>Private method to dedent the last line to the last if statement with less (or equal) indentation.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#CompleterPython.__inComment">__inComment</a></td> |
|
97 <td>Private method to check, if the cursor is inside a comment.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#CompleterPython.__inDoubleQuotedString">__inDoubleQuotedString</a></td> |
|
101 <td>Private method to check, if the cursor is within a double quoted string.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#CompleterPython.__inSingleQuotedString">__inSingleQuotedString</a></td> |
|
105 <td>Private method to check, if the cursor is within a single quoted string.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#CompleterPython.__inTripleDoubleQuotedString">__inTripleDoubleQuotedString</a></td> |
|
109 <td>Private method to check, if the cursor is within a triple double quoted string.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#CompleterPython.__inTripleSingleQuotedString">__inTripleSingleQuotedString</a></td> |
|
113 <td>Private method to check, if the cursor is within a triple single quoted string.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#CompleterPython.__isClassMethod">__isClassMethod</a></td> |
|
117 <td>Private method to check, if the user is defining a class method.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#CompleterPython.__isClassMethodDef">__isClassMethodDef</a></td> |
|
121 <td>Private method to check, if the user is defing a class method (@classmethod).</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#CompleterPython.__isStaticMethodDef">__isStaticMethodDef</a></td> |
|
125 <td>Private method to check, if the user is defing a static method (@staticmethod) method.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#CompleterPython.charAdded">charAdded</a></td> |
|
129 <td>Public slot called to handle the user entering a character.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#CompleterPython.readSettings">readSettings</a></td> |
|
133 <td>Public slot called to reread the configuration parameters.</td> |
|
134 </tr> |
|
135 </table> |
|
136 <h3>Static Methods</h3> |
|
137 |
|
138 <table> |
|
139 <tr><td>None</td></tr> |
|
140 </table> |
|
141 |
|
142 <a NAME="CompleterPython.__init__" ID="CompleterPython.__init__"></a> |
|
143 <h4>CompleterPython (Constructor)</h4> |
|
144 <b>CompleterPython</b>(<i>editor, parent=None</i>) |
|
145 |
|
146 <p> |
|
147 Constructor |
|
148 </p> |
|
149 <dl> |
|
150 |
|
151 <dt><i>editor</i></dt> |
|
152 <dd> |
|
153 reference to the editor object (QScintilla.Editor) |
|
154 </dd> |
|
155 <dt><i>parent</i></dt> |
|
156 <dd> |
|
157 reference to the parent object (QObject) |
|
158 </dd> |
|
159 </dl> |
|
160 <a NAME="CompleterPython.__dedentDefStatement" ID="CompleterPython.__dedentDefStatement"></a> |
|
161 <h4>CompleterPython.__dedentDefStatement</h4> |
|
162 <b>__dedentDefStatement</b>(<i></i>) |
|
163 |
|
164 <p> |
|
165 Private method to dedent the line of the def statement to a previous |
|
166 def statement or class statement. |
|
167 </p> |
|
168 <a NAME="CompleterPython.__dedentElseToIfWhileForTry" ID="CompleterPython.__dedentElseToIfWhileForTry"></a> |
|
169 <h4>CompleterPython.__dedentElseToIfWhileForTry</h4> |
|
170 <b>__dedentElseToIfWhileForTry</b>(<i></i>) |
|
171 |
|
172 <p> |
|
173 Private method to dedent the line of the else statement to the last |
|
174 if, while, for or try statement with less (or equal) indentation. |
|
175 </p> |
|
176 <a NAME="CompleterPython.__dedentExceptToTry" ID="CompleterPython.__dedentExceptToTry"></a> |
|
177 <h4>CompleterPython.__dedentExceptToTry</h4> |
|
178 <b>__dedentExceptToTry</b>(<i>hasColon</i>) |
|
179 |
|
180 <p> |
|
181 Private method to dedent the line of the except statement to the last |
|
182 try statement with less (or equal) indentation. |
|
183 </p> |
|
184 <dl> |
|
185 |
|
186 <dt><i>hasColon</i></dt> |
|
187 <dd> |
|
188 flag indicating the except type (boolean) |
|
189 </dd> |
|
190 </dl> |
|
191 <a NAME="CompleterPython.__dedentFinallyToTry" ID="CompleterPython.__dedentFinallyToTry"></a> |
|
192 <h4>CompleterPython.__dedentFinallyToTry</h4> |
|
193 <b>__dedentFinallyToTry</b>(<i></i>) |
|
194 |
|
195 <p> |
|
196 Private method to dedent the line of the except statement to the last |
|
197 try statement with less (or equal) indentation. |
|
198 </p> |
|
199 <a NAME="CompleterPython.__dedentToIf" ID="CompleterPython.__dedentToIf"></a> |
|
200 <h4>CompleterPython.__dedentToIf</h4> |
|
201 <b>__dedentToIf</b>(<i></i>) |
|
202 |
|
203 <p> |
|
204 Private method to dedent the last line to the last if statement with |
|
205 less (or equal) indentation. |
|
206 </p> |
|
207 <a NAME="CompleterPython.__inComment" ID="CompleterPython.__inComment"></a> |
|
208 <h4>CompleterPython.__inComment</h4> |
|
209 <b>__inComment</b>(<i>line, col</i>) |
|
210 |
|
211 <p> |
|
212 Private method to check, if the cursor is inside a comment. |
|
213 </p> |
|
214 <dl> |
|
215 |
|
216 <dt><i>line</i></dt> |
|
217 <dd> |
|
218 current line (integer) |
|
219 </dd> |
|
220 <dt><i>col</i></dt> |
|
221 <dd> |
|
222 current position within line (integer) |
|
223 </dd> |
|
224 </dl> |
|
225 <dl> |
|
226 <dt>Return:</dt> |
|
227 <dd> |
|
228 flag indicating, if the cursor is inside a comment (boolean) |
|
229 </dd> |
|
230 </dl> |
|
231 <a NAME="CompleterPython.__inDoubleQuotedString" ID="CompleterPython.__inDoubleQuotedString"></a> |
|
232 <h4>CompleterPython.__inDoubleQuotedString</h4> |
|
233 <b>__inDoubleQuotedString</b>(<i></i>) |
|
234 |
|
235 <p> |
|
236 Private method to check, if the cursor is within a double quoted |
|
237 string. |
|
238 </p> |
|
239 <dl> |
|
240 <dt>Return:</dt> |
|
241 <dd> |
|
242 flag indicating, if the cursor is inside a double |
|
243 quoted string (boolean) |
|
244 </dd> |
|
245 </dl> |
|
246 <a NAME="CompleterPython.__inSingleQuotedString" ID="CompleterPython.__inSingleQuotedString"></a> |
|
247 <h4>CompleterPython.__inSingleQuotedString</h4> |
|
248 <b>__inSingleQuotedString</b>(<i></i>) |
|
249 |
|
250 <p> |
|
251 Private method to check, if the cursor is within a single quoted |
|
252 string. |
|
253 </p> |
|
254 <dl> |
|
255 <dt>Return:</dt> |
|
256 <dd> |
|
257 flag indicating, if the cursor is inside a single |
|
258 quoted string (boolean) |
|
259 </dd> |
|
260 </dl> |
|
261 <a NAME="CompleterPython.__inTripleDoubleQuotedString" ID="CompleterPython.__inTripleDoubleQuotedString"></a> |
|
262 <h4>CompleterPython.__inTripleDoubleQuotedString</h4> |
|
263 <b>__inTripleDoubleQuotedString</b>(<i></i>) |
|
264 |
|
265 <p> |
|
266 Private method to check, if the cursor is within a triple double |
|
267 quoted string. |
|
268 </p> |
|
269 <dl> |
|
270 <dt>Return:</dt> |
|
271 <dd> |
|
272 flag indicating, if the cursor is inside a triple double |
|
273 quoted string (boolean) |
|
274 </dd> |
|
275 </dl> |
|
276 <a NAME="CompleterPython.__inTripleSingleQuotedString" ID="CompleterPython.__inTripleSingleQuotedString"></a> |
|
277 <h4>CompleterPython.__inTripleSingleQuotedString</h4> |
|
278 <b>__inTripleSingleQuotedString</b>(<i></i>) |
|
279 |
|
280 <p> |
|
281 Private method to check, if the cursor is within a triple single |
|
282 quoted string. |
|
283 </p> |
|
284 <dl> |
|
285 <dt>Return:</dt> |
|
286 <dd> |
|
287 flag indicating, if the cursor is inside a triple single |
|
288 quoted string (boolean) |
|
289 </dd> |
|
290 </dl> |
|
291 <a NAME="CompleterPython.__isClassMethod" ID="CompleterPython.__isClassMethod"></a> |
|
292 <h4>CompleterPython.__isClassMethod</h4> |
|
293 <b>__isClassMethod</b>(<i></i>) |
|
294 |
|
295 <p> |
|
296 Private method to check, if the user is defining a class method. |
|
297 </p> |
|
298 <dl> |
|
299 <dt>Return:</dt> |
|
300 <dd> |
|
301 flag indicating the definition of a class method (boolean) |
|
302 </dd> |
|
303 </dl> |
|
304 <a NAME="CompleterPython.__isClassMethodDef" ID="CompleterPython.__isClassMethodDef"></a> |
|
305 <h4>CompleterPython.__isClassMethodDef</h4> |
|
306 <b>__isClassMethodDef</b>(<i></i>) |
|
307 |
|
308 <p> |
|
309 Private method to check, if the user is defing a class method |
|
310 (@classmethod). |
|
311 </p> |
|
312 <dl> |
|
313 <dt>Return:</dt> |
|
314 <dd> |
|
315 flag indicating the definition of a class method (boolean) |
|
316 </dd> |
|
317 </dl> |
|
318 <a NAME="CompleterPython.__isStaticMethodDef" ID="CompleterPython.__isStaticMethodDef"></a> |
|
319 <h4>CompleterPython.__isStaticMethodDef</h4> |
|
320 <b>__isStaticMethodDef</b>(<i></i>) |
|
321 |
|
322 <p> |
|
323 Private method to check, if the user is defing a static method |
|
324 (@staticmethod) method. |
|
325 </p> |
|
326 <dl> |
|
327 <dt>Return:</dt> |
|
328 <dd> |
|
329 flag indicating the definition of a static method (boolean) |
|
330 </dd> |
|
331 </dl> |
|
332 <a NAME="CompleterPython.charAdded" ID="CompleterPython.charAdded"></a> |
|
333 <h4>CompleterPython.charAdded</h4> |
|
334 <b>charAdded</b>(<i>charNumber</i>) |
|
335 |
|
336 <p> |
|
337 Public slot called to handle the user entering a character. |
|
338 </p> |
|
339 <dl> |
|
340 |
|
341 <dt><i>charNumber</i></dt> |
|
342 <dd> |
|
343 value of the character entered (integer) |
|
344 </dd> |
|
345 </dl> |
|
346 <a NAME="CompleterPython.readSettings" ID="CompleterPython.readSettings"></a> |
|
347 <h4>CompleterPython.readSettings</h4> |
|
348 <b>readSettings</b>(<i></i>) |
|
349 |
|
350 <p> |
|
351 Public slot called to reread the configuration parameters. |
|
352 </p> |
|
353 <div align="right"><a href="#top">Up</a></div> |
|
354 <hr /> |
|
355 </body></html> |