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