|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog</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.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing a simple Python syntax checker. |
|
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="#SyntaxCheckerDialog">SyntaxCheckerDialog</a></td> |
|
39 <td>Class implementing a dialog to display the results of a syntax check run.</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="SyntaxCheckerDialog" ID="SyntaxCheckerDialog"></a> |
|
50 <h2>SyntaxCheckerDialog</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing a dialog to display the results of a syntax check run. |
|
54 </p> |
|
55 <h3>Derived from</h3> |
|
56 QDialog, Ui_SyntaxCheckerDialog |
|
57 <h3>Class Attributes</h3> |
|
58 |
|
59 <table> |
|
60 <tr><td>errorRole</td></tr><tr><td>filenameRole</td></tr><tr><td>indexRole</td></tr><tr><td>lineRole</td></tr><tr><td>warningRole</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="#SyntaxCheckerDialog.__init__">SyntaxCheckerDialog</a></td> |
|
73 <td>Constructor</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#SyntaxCheckerDialog.__batchFinished">__batchFinished</a></td> |
|
77 <td>Private slot handling the completion of a batch job.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#SyntaxCheckerDialog.__clearErrors">__clearErrors</a></td> |
|
81 <td>Private method to clear all error and warning markers of open editors to be checked.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#SyntaxCheckerDialog.__createErrorItem">__createErrorItem</a></td> |
|
85 <td>Private slot to create a new error item in the result list.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#SyntaxCheckerDialog.__createResultItem">__createResultItem</a></td> |
|
89 <td>Private method to create an entry in the result list.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#SyntaxCheckerDialog.__finish">__finish</a></td> |
|
93 <td>Private slot called when the syntax check finished or the user pressed the button.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#SyntaxCheckerDialog.__processError">__processError</a></td> |
|
97 <td>Private slot to process an error indication from the service.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#SyntaxCheckerDialog.__processResult">__processResult</a></td> |
|
101 <td>Private slot to display the reported messages.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#SyntaxCheckerDialog.__resort">__resort</a></td> |
|
105 <td>Private method to resort the tree.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#SyntaxCheckerDialog.check">check</a></td> |
|
109 <td>Public method to start a check for one file.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#SyntaxCheckerDialog.checkBatch">checkBatch</a></td> |
|
113 <td>Public method to start a style check batch job.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#SyntaxCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
117 <td>Private slot called by a button of the button box clicked.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#SyntaxCheckerDialog.on_resultList_itemActivated">on_resultList_itemActivated</a></td> |
|
121 <td>Private slot to handle the activation of an item.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#SyntaxCheckerDialog.on_showButton_clicked">on_showButton_clicked</a></td> |
|
125 <td>Private slot to handle the "Show" button press.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#SyntaxCheckerDialog.on_startButton_clicked">on_startButton_clicked</a></td> |
|
129 <td>Private slot to start a syntax check run.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#SyntaxCheckerDialog.prepare">prepare</a></td> |
|
133 <td>Public method to prepare the dialog with a list of filenames.</td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td><a href="#SyntaxCheckerDialog.start">start</a></td> |
|
137 <td>Public slot to start the syntax check.</td> |
|
138 </tr> |
|
139 </table> |
|
140 <h3>Static Methods</h3> |
|
141 |
|
142 <table> |
|
143 <tr><td>None</td></tr> |
|
144 </table> |
|
145 |
|
146 <a NAME="SyntaxCheckerDialog.__init__" ID="SyntaxCheckerDialog.__init__"></a> |
|
147 <h4>SyntaxCheckerDialog (Constructor)</h4> |
|
148 <b>SyntaxCheckerDialog</b>(<i>parent=None</i>) |
|
149 |
|
150 <p> |
|
151 Constructor |
|
152 </p> |
|
153 <dl> |
|
154 |
|
155 <dt><i>parent</i></dt> |
|
156 <dd> |
|
157 The parent widget. (QWidget) |
|
158 </dd> |
|
159 </dl> |
|
160 <a NAME="SyntaxCheckerDialog.__batchFinished" ID="SyntaxCheckerDialog.__batchFinished"></a> |
|
161 <h4>SyntaxCheckerDialog.__batchFinished</h4> |
|
162 <b>__batchFinished</b>(<i></i>) |
|
163 |
|
164 <p> |
|
165 Private slot handling the completion of a batch job. |
|
166 </p> |
|
167 <a NAME="SyntaxCheckerDialog.__clearErrors" ID="SyntaxCheckerDialog.__clearErrors"></a> |
|
168 <h4>SyntaxCheckerDialog.__clearErrors</h4> |
|
169 <b>__clearErrors</b>(<i>files</i>) |
|
170 |
|
171 <p> |
|
172 Private method to clear all error and warning markers of |
|
173 open editors to be checked. |
|
174 </p> |
|
175 <dl> |
|
176 |
|
177 <dt><i>files</i></dt> |
|
178 <dd> |
|
179 list of files to be checked (list of string) |
|
180 </dd> |
|
181 </dl> |
|
182 <a NAME="SyntaxCheckerDialog.__createErrorItem" ID="SyntaxCheckerDialog.__createErrorItem"></a> |
|
183 <h4>SyntaxCheckerDialog.__createErrorItem</h4> |
|
184 <b>__createErrorItem</b>(<i>filename, message</i>) |
|
185 |
|
186 <p> |
|
187 Private slot to create a new error item in the result list. |
|
188 </p> |
|
189 <dl> |
|
190 |
|
191 <dt><i>filename</i> (str)</dt> |
|
192 <dd> |
|
193 name of the file |
|
194 </dd> |
|
195 <dt><i>message</i> (str)</dt> |
|
196 <dd> |
|
197 error message |
|
198 </dd> |
|
199 </dl> |
|
200 <a NAME="SyntaxCheckerDialog.__createResultItem" ID="SyntaxCheckerDialog.__createResultItem"></a> |
|
201 <h4>SyntaxCheckerDialog.__createResultItem</h4> |
|
202 <b>__createResultItem</b>(<i>filename, line, index, error, sourcecode, isWarning=False</i>) |
|
203 |
|
204 <p> |
|
205 Private method to create an entry in the result list. |
|
206 </p> |
|
207 <dl> |
|
208 |
|
209 <dt><i>filename</i></dt> |
|
210 <dd> |
|
211 file name of file (string) |
|
212 </dd> |
|
213 <dt><i>line</i></dt> |
|
214 <dd> |
|
215 line number of faulty source (integer or string) |
|
216 </dd> |
|
217 <dt><i>index</i></dt> |
|
218 <dd> |
|
219 index number of fault (integer) |
|
220 </dd> |
|
221 <dt><i>error</i></dt> |
|
222 <dd> |
|
223 error text (string) |
|
224 </dd> |
|
225 <dt><i>sourcecode</i></dt> |
|
226 <dd> |
|
227 faulty line of code (string) |
|
228 </dd> |
|
229 <dt><i>isWarning</i></dt> |
|
230 <dd> |
|
231 flag indicating a warning message (boolean) |
|
232 </dd> |
|
233 </dl> |
|
234 <a NAME="SyntaxCheckerDialog.__finish" ID="SyntaxCheckerDialog.__finish"></a> |
|
235 <h4>SyntaxCheckerDialog.__finish</h4> |
|
236 <b>__finish</b>(<i></i>) |
|
237 |
|
238 <p> |
|
239 Private slot called when the syntax check finished or the user |
|
240 pressed the button. |
|
241 </p> |
|
242 <a NAME="SyntaxCheckerDialog.__processError" ID="SyntaxCheckerDialog.__processError"></a> |
|
243 <h4>SyntaxCheckerDialog.__processError</h4> |
|
244 <b>__processError</b>(<i>fn, msg</i>) |
|
245 |
|
246 <p> |
|
247 Private slot to process an error indication from the service. |
|
248 </p> |
|
249 <dl> |
|
250 |
|
251 <dt><i>fn</i> (str)</dt> |
|
252 <dd> |
|
253 filename of the file |
|
254 </dd> |
|
255 <dt><i>msg</i> (str)</dt> |
|
256 <dd> |
|
257 error message |
|
258 </dd> |
|
259 </dl> |
|
260 <a NAME="SyntaxCheckerDialog.__processResult" ID="SyntaxCheckerDialog.__processResult"></a> |
|
261 <h4>SyntaxCheckerDialog.__processResult</h4> |
|
262 <b>__processResult</b>(<i>fn, problems</i>) |
|
263 |
|
264 <p> |
|
265 Private slot to display the reported messages. |
|
266 </p> |
|
267 <dl> |
|
268 |
|
269 <dt><i>fn</i></dt> |
|
270 <dd> |
|
271 filename of the checked file (str) |
|
272 </dd> |
|
273 <dt><i>problems</i></dt> |
|
274 <dd> |
|
275 dictionary with the keys 'error' and 'warnings' which |
|
276 hold a list containing details about the error/ warnings |
|
277 (file name, line number, column, codestring (only at syntax |
|
278 errors), the message) (dict) |
|
279 </dd> |
|
280 </dl> |
|
281 <a NAME="SyntaxCheckerDialog.__resort" ID="SyntaxCheckerDialog.__resort"></a> |
|
282 <h4>SyntaxCheckerDialog.__resort</h4> |
|
283 <b>__resort</b>(<i></i>) |
|
284 |
|
285 <p> |
|
286 Private method to resort the tree. |
|
287 </p> |
|
288 <a NAME="SyntaxCheckerDialog.check" ID="SyntaxCheckerDialog.check"></a> |
|
289 <h4>SyntaxCheckerDialog.check</h4> |
|
290 <b>check</b>(<i>codestring=''</i>) |
|
291 |
|
292 <p> |
|
293 Public method to start a check for one file. |
|
294 </p> |
|
295 <p> |
|
296 The results are reported to the __processResult slot. |
|
297 </p> |
|
298 <dl> |
|
299 |
|
300 <dt><i>codestring</i></dt> |
|
301 <dd> |
|
302 optional sourcestring (str) |
|
303 </dd> |
|
304 </dl> |
|
305 <a NAME="SyntaxCheckerDialog.checkBatch" ID="SyntaxCheckerDialog.checkBatch"></a> |
|
306 <h4>SyntaxCheckerDialog.checkBatch</h4> |
|
307 <b>checkBatch</b>(<i></i>) |
|
308 |
|
309 <p> |
|
310 Public method to start a style check batch job. |
|
311 </p> |
|
312 <p> |
|
313 The results are reported to the __processResult slot. |
|
314 </p> |
|
315 <a NAME="SyntaxCheckerDialog.on_buttonBox_clicked" ID="SyntaxCheckerDialog.on_buttonBox_clicked"></a> |
|
316 <h4>SyntaxCheckerDialog.on_buttonBox_clicked</h4> |
|
317 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
318 |
|
319 <p> |
|
320 Private slot called by a button of the button box clicked. |
|
321 </p> |
|
322 <dl> |
|
323 |
|
324 <dt><i>button</i></dt> |
|
325 <dd> |
|
326 button that was clicked (QAbstractButton) |
|
327 </dd> |
|
328 </dl> |
|
329 <a NAME="SyntaxCheckerDialog.on_resultList_itemActivated" ID="SyntaxCheckerDialog.on_resultList_itemActivated"></a> |
|
330 <h4>SyntaxCheckerDialog.on_resultList_itemActivated</h4> |
|
331 <b>on_resultList_itemActivated</b>(<i>itm, col</i>) |
|
332 |
|
333 <p> |
|
334 Private slot to handle the activation of an item. |
|
335 </p> |
|
336 <dl> |
|
337 |
|
338 <dt><i>itm</i></dt> |
|
339 <dd> |
|
340 reference to the activated item (QTreeWidgetItem) |
|
341 </dd> |
|
342 <dt><i>col</i></dt> |
|
343 <dd> |
|
344 column the item was activated in (integer) |
|
345 </dd> |
|
346 </dl> |
|
347 <a NAME="SyntaxCheckerDialog.on_showButton_clicked" ID="SyntaxCheckerDialog.on_showButton_clicked"></a> |
|
348 <h4>SyntaxCheckerDialog.on_showButton_clicked</h4> |
|
349 <b>on_showButton_clicked</b>(<i></i>) |
|
350 |
|
351 <p> |
|
352 Private slot to handle the "Show" button press. |
|
353 </p> |
|
354 <a NAME="SyntaxCheckerDialog.on_startButton_clicked" ID="SyntaxCheckerDialog.on_startButton_clicked"></a> |
|
355 <h4>SyntaxCheckerDialog.on_startButton_clicked</h4> |
|
356 <b>on_startButton_clicked</b>(<i></i>) |
|
357 |
|
358 <p> |
|
359 Private slot to start a syntax check run. |
|
360 </p> |
|
361 <a NAME="SyntaxCheckerDialog.prepare" ID="SyntaxCheckerDialog.prepare"></a> |
|
362 <h4>SyntaxCheckerDialog.prepare</h4> |
|
363 <b>prepare</b>(<i>fileList, project</i>) |
|
364 |
|
365 <p> |
|
366 Public method to prepare the dialog with a list of filenames. |
|
367 </p> |
|
368 <dl> |
|
369 |
|
370 <dt><i>fileList</i></dt> |
|
371 <dd> |
|
372 list of filenames (list of strings) |
|
373 </dd> |
|
374 <dt><i>project</i></dt> |
|
375 <dd> |
|
376 reference to the project object (Project) |
|
377 </dd> |
|
378 </dl> |
|
379 <a NAME="SyntaxCheckerDialog.start" ID="SyntaxCheckerDialog.start"></a> |
|
380 <h4>SyntaxCheckerDialog.start</h4> |
|
381 <b>start</b>(<i>fn, codestring=""</i>) |
|
382 |
|
383 <p> |
|
384 Public slot to start the syntax check. |
|
385 </p> |
|
386 <dl> |
|
387 |
|
388 <dt><i>fn</i></dt> |
|
389 <dd> |
|
390 file or list of files or directory to be checked |
|
391 (string or list of strings) |
|
392 </dd> |
|
393 <dt><i>codestring</i></dt> |
|
394 <dd> |
|
395 string containing the code to be checked (string). |
|
396 If this is given, fn must be a single file name. |
|
397 </dd> |
|
398 </dl> |
|
399 <div align="right"><a href="#top">Up</a></div> |
|
400 <hr /> |
|
401 </body></html> |