|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.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><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.QScintilla.TypingCompleters.CompleterPython</h1> |
|
23 <p> |
|
24 Module implementing a typing completer for Python. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#CompleterPython">CompleterPython</a></td> |
|
34 <td>Class implementing typing completer for Python.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="CompleterPython" ID="CompleterPython"></a> |
|
43 <h2>CompleterPython</h2> |
|
44 <p> |
|
45 Class implementing typing completer for Python. |
|
46 </p> |
|
47 <h3>Derived from</h3> |
|
48 CompleterBase |
|
49 <h3>Class Attributes</h3> |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Class Methods</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#CompleterPython.__init__">CompleterPython</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#CompleterPython.__dedentDefStatement">__dedentDefStatement</a></td> |
|
64 <td>Private method to dedent the line of the def statement to a previous def statement or class statement.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#CompleterPython.__dedentElseToIfWhileForTry">__dedentElseToIfWhileForTry</a></td> |
|
67 <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> |
|
68 </tr><tr> |
|
69 <td><a href="#CompleterPython.__dedentExceptToTry">__dedentExceptToTry</a></td> |
|
70 <td>Private method to dedent the line of the except statement to the last try statement with less (or equal) indentation.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#CompleterPython.__dedentFinallyToTry">__dedentFinallyToTry</a></td> |
|
73 <td>Private method to dedent the line of the except statement to the last try statement with less (or equal) indentation.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#CompleterPython.__dedentToIf">__dedentToIf</a></td> |
|
76 <td>Private method to dedent the last line to the last if statement with less (or equal) indentation.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#CompleterPython.__inComment">__inComment</a></td> |
|
79 <td>Private method to check, if the cursor is inside a comment.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#CompleterPython.__inDoubleQuotedString">__inDoubleQuotedString</a></td> |
|
82 <td>Private method to check, if the cursor is within a double quoted string.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#CompleterPython.__inSingleQuotedString">__inSingleQuotedString</a></td> |
|
85 <td>Private method to check, if the cursor is within a single quoted string.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#CompleterPython.__inTripleDoubleQuotedString">__inTripleDoubleQuotedString</a></td> |
|
88 <td>Private method to check, if the cursor is within a triple double quoted string.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#CompleterPython.__inTripleSingleQuotedString">__inTripleSingleQuotedString</a></td> |
|
91 <td>Private method to check, if the cursor is within a triple single quoted string.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#CompleterPython.__isClassMethod">__isClassMethod</a></td> |
|
94 <td>Private method to check, if the user is defining a class method.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#CompleterPython.__isClassMethodDef">__isClassMethodDef</a></td> |
|
97 <td>Private method to check, if the user is defing a class method (@classmethod).</td> |
|
98 </tr><tr> |
|
99 <td><a href="#CompleterPython.__isStaticMethodDef">__isStaticMethodDef</a></td> |
|
100 <td>Private method to check, if the user is defing a static method (@staticmethod) method.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#CompleterPython.charAdded">charAdded</a></td> |
|
103 <td>Public slot called to handle the user entering a character.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#CompleterPython.readSettings">readSettings</a></td> |
|
106 <td>Public slot called to reread the configuration parameters.</td> |
|
107 </tr> |
|
108 </table> |
|
109 <h3>Static Methods</h3> |
|
110 <table> |
|
111 <tr><td>None</td></tr> |
|
112 </table> |
|
113 <a NAME="CompleterPython.__init__" ID="CompleterPython.__init__"></a> |
|
114 <h4>CompleterPython (Constructor)</h4> |
|
115 <b>CompleterPython</b>(<i>editor, parent=None</i>) |
|
116 <p> |
|
117 Constructor |
|
118 </p><dl> |
|
119 <dt><i>editor</i></dt> |
|
120 <dd> |
|
121 reference to the editor object (QScintilla.Editor) |
|
122 </dd><dt><i>parent</i></dt> |
|
123 <dd> |
|
124 reference to the parent object (QObject) |
|
125 </dd> |
|
126 </dl><a NAME="CompleterPython.__dedentDefStatement" ID="CompleterPython.__dedentDefStatement"></a> |
|
127 <h4>CompleterPython.__dedentDefStatement</h4> |
|
128 <b>__dedentDefStatement</b>(<i></i>) |
|
129 <p> |
|
130 Private method to dedent the line of the def statement to a previous |
|
131 def statement or class statement. |
|
132 </p><a NAME="CompleterPython.__dedentElseToIfWhileForTry" ID="CompleterPython.__dedentElseToIfWhileForTry"></a> |
|
133 <h4>CompleterPython.__dedentElseToIfWhileForTry</h4> |
|
134 <b>__dedentElseToIfWhileForTry</b>(<i></i>) |
|
135 <p> |
|
136 Private method to dedent the line of the else statement to the last |
|
137 if, while, for or try statement with less (or equal) indentation. |
|
138 </p><a NAME="CompleterPython.__dedentExceptToTry" ID="CompleterPython.__dedentExceptToTry"></a> |
|
139 <h4>CompleterPython.__dedentExceptToTry</h4> |
|
140 <b>__dedentExceptToTry</b>(<i>hasColon</i>) |
|
141 <p> |
|
142 Private method to dedent the line of the except statement to the last |
|
143 try statement with less (or equal) indentation. |
|
144 </p><dl> |
|
145 <dt><i>hasColon</i></dt> |
|
146 <dd> |
|
147 flag indicating the except type (boolean) |
|
148 </dd> |
|
149 </dl><a NAME="CompleterPython.__dedentFinallyToTry" ID="CompleterPython.__dedentFinallyToTry"></a> |
|
150 <h4>CompleterPython.__dedentFinallyToTry</h4> |
|
151 <b>__dedentFinallyToTry</b>(<i></i>) |
|
152 <p> |
|
153 Private method to dedent the line of the except statement to the last |
|
154 try statement with less (or equal) indentation. |
|
155 </p><a NAME="CompleterPython.__dedentToIf" ID="CompleterPython.__dedentToIf"></a> |
|
156 <h4>CompleterPython.__dedentToIf</h4> |
|
157 <b>__dedentToIf</b>(<i></i>) |
|
158 <p> |
|
159 Private method to dedent the last line to the last if statement with |
|
160 less (or equal) indentation. |
|
161 </p><a NAME="CompleterPython.__inComment" ID="CompleterPython.__inComment"></a> |
|
162 <h4>CompleterPython.__inComment</h4> |
|
163 <b>__inComment</b>(<i>line, col</i>) |
|
164 <p> |
|
165 Private method to check, if the cursor is inside a comment. |
|
166 </p><dl> |
|
167 <dt><i>line</i></dt> |
|
168 <dd> |
|
169 current line (integer) |
|
170 </dd><dt><i>col</i></dt> |
|
171 <dd> |
|
172 current position within line (integer) |
|
173 </dd> |
|
174 </dl><dl> |
|
175 <dt>Returns:</dt> |
|
176 <dd> |
|
177 flag indicating, if the cursor is inside a comment (boolean) |
|
178 </dd> |
|
179 </dl><a NAME="CompleterPython.__inDoubleQuotedString" ID="CompleterPython.__inDoubleQuotedString"></a> |
|
180 <h4>CompleterPython.__inDoubleQuotedString</h4> |
|
181 <b>__inDoubleQuotedString</b>(<i></i>) |
|
182 <p> |
|
183 Private method to check, if the cursor is within a double quoted |
|
184 string. |
|
185 </p><dl> |
|
186 <dt>Returns:</dt> |
|
187 <dd> |
|
188 flag indicating, if the cursor is inside a double |
|
189 quoted string (boolean) |
|
190 </dd> |
|
191 </dl><a NAME="CompleterPython.__inSingleQuotedString" ID="CompleterPython.__inSingleQuotedString"></a> |
|
192 <h4>CompleterPython.__inSingleQuotedString</h4> |
|
193 <b>__inSingleQuotedString</b>(<i></i>) |
|
194 <p> |
|
195 Private method to check, if the cursor is within a single quoted |
|
196 string. |
|
197 </p><dl> |
|
198 <dt>Returns:</dt> |
|
199 <dd> |
|
200 flag indicating, if the cursor is inside a single |
|
201 quoted string (boolean) |
|
202 </dd> |
|
203 </dl><a NAME="CompleterPython.__inTripleDoubleQuotedString" ID="CompleterPython.__inTripleDoubleQuotedString"></a> |
|
204 <h4>CompleterPython.__inTripleDoubleQuotedString</h4> |
|
205 <b>__inTripleDoubleQuotedString</b>(<i></i>) |
|
206 <p> |
|
207 Private method to check, if the cursor is within a triple double |
|
208 quoted string. |
|
209 </p><dl> |
|
210 <dt>Returns:</dt> |
|
211 <dd> |
|
212 flag indicating, if the cursor is inside a triple double |
|
213 quoted string (boolean) |
|
214 </dd> |
|
215 </dl><a NAME="CompleterPython.__inTripleSingleQuotedString" ID="CompleterPython.__inTripleSingleQuotedString"></a> |
|
216 <h4>CompleterPython.__inTripleSingleQuotedString</h4> |
|
217 <b>__inTripleSingleQuotedString</b>(<i></i>) |
|
218 <p> |
|
219 Private method to check, if the cursor is within a triple single |
|
220 quoted string. |
|
221 </p><dl> |
|
222 <dt>Returns:</dt> |
|
223 <dd> |
|
224 flag indicating, if the cursor is inside a triple single |
|
225 quoted string (boolean) |
|
226 </dd> |
|
227 </dl><a NAME="CompleterPython.__isClassMethod" ID="CompleterPython.__isClassMethod"></a> |
|
228 <h4>CompleterPython.__isClassMethod</h4> |
|
229 <b>__isClassMethod</b>(<i></i>) |
|
230 <p> |
|
231 Private method to check, if the user is defining a class method. |
|
232 </p><dl> |
|
233 <dt>Returns:</dt> |
|
234 <dd> |
|
235 flag indicating the definition of a class method (boolean) |
|
236 </dd> |
|
237 </dl><a NAME="CompleterPython.__isClassMethodDef" ID="CompleterPython.__isClassMethodDef"></a> |
|
238 <h4>CompleterPython.__isClassMethodDef</h4> |
|
239 <b>__isClassMethodDef</b>(<i></i>) |
|
240 <p> |
|
241 Private method to check, if the user is defing a class method |
|
242 (@classmethod). |
|
243 </p><dl> |
|
244 <dt>Returns:</dt> |
|
245 <dd> |
|
246 flag indicating the definition of a class method (boolean) |
|
247 </dd> |
|
248 </dl><a NAME="CompleterPython.__isStaticMethodDef" ID="CompleterPython.__isStaticMethodDef"></a> |
|
249 <h4>CompleterPython.__isStaticMethodDef</h4> |
|
250 <b>__isStaticMethodDef</b>(<i></i>) |
|
251 <p> |
|
252 Private method to check, if the user is defing a static method |
|
253 (@staticmethod) method. |
|
254 </p><dl> |
|
255 <dt>Returns:</dt> |
|
256 <dd> |
|
257 flag indicating the definition of a static method (boolean) |
|
258 </dd> |
|
259 </dl><a NAME="CompleterPython.charAdded" ID="CompleterPython.charAdded"></a> |
|
260 <h4>CompleterPython.charAdded</h4> |
|
261 <b>charAdded</b>(<i>charNumber</i>) |
|
262 <p> |
|
263 Public slot called to handle the user entering a character. |
|
264 </p><dl> |
|
265 <dt><i>charNumber</i></dt> |
|
266 <dd> |
|
267 value of the character entered (integer) |
|
268 </dd> |
|
269 </dl><a NAME="CompleterPython.readSettings" ID="CompleterPython.readSettings"></a> |
|
270 <h4>CompleterPython.readSettings</h4> |
|
271 <b>readSettings</b>(<i></i>) |
|
272 <p> |
|
273 Public slot called to reread the configuration parameters. |
|
274 </p> |
|
275 <div align="right"><a href="#top">Up</a></div> |
|
276 <hr /> |
|
277 </body></html> |