|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.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><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog</h1> |
|
23 <p> |
|
24 Module implementing a simple Python syntax checker. |
|
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="#SyntaxCheckerDialog">SyntaxCheckerDialog</a></td> |
|
34 <td>Class implementing a dialog to display the results of a syntax check run.</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="SyntaxCheckerDialog" ID="SyntaxCheckerDialog"></a> |
|
43 <h2>SyntaxCheckerDialog</h2> |
|
44 <p> |
|
45 Class implementing a dialog to display the results of a syntax check run. |
|
46 </p> |
|
47 <h3>Derived from</h3> |
|
48 QDialog, Ui_SyntaxCheckerDialog |
|
49 <h3>Class Attributes</h3> |
|
50 <table> |
|
51 <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> |
|
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="#SyntaxCheckerDialog.__init__">SyntaxCheckerDialog</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#SyntaxCheckerDialog.__batchFinished">__batchFinished</a></td> |
|
64 <td>Private slot handling the completion of a batch job.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#SyntaxCheckerDialog.__clearErrors">__clearErrors</a></td> |
|
67 <td>Private method to clear all error and warning markers of open editors to be checked.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#SyntaxCheckerDialog.__createErrorItem">__createErrorItem</a></td> |
|
70 <td>Private slot to create a new error item in the result list.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#SyntaxCheckerDialog.__createResultItem">__createResultItem</a></td> |
|
73 <td>Private method to create an entry in the result list.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#SyntaxCheckerDialog.__finish">__finish</a></td> |
|
76 <td>Private slot called when the syntax check finished or the user pressed the button.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#SyntaxCheckerDialog.__processError">__processError</a></td> |
|
79 <td>Private slot to process an error indication from the service.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#SyntaxCheckerDialog.__processResult">__processResult</a></td> |
|
82 <td>Private slot to display the reported messages.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#SyntaxCheckerDialog.__resort">__resort</a></td> |
|
85 <td>Private method to resort the tree.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#SyntaxCheckerDialog.check">check</a></td> |
|
88 <td>Public method to start a check for one file.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#SyntaxCheckerDialog.checkBatch">checkBatch</a></td> |
|
91 <td>Public method to start a style check batch job.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#SyntaxCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
94 <td>Private slot called by a button of the button box clicked.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#SyntaxCheckerDialog.on_resultList_itemActivated">on_resultList_itemActivated</a></td> |
|
97 <td>Private slot to handle the activation of an item.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#SyntaxCheckerDialog.on_showButton_clicked">on_showButton_clicked</a></td> |
|
100 <td>Private slot to handle the "Show" button press.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#SyntaxCheckerDialog.on_startButton_clicked">on_startButton_clicked</a></td> |
|
103 <td>Private slot to start a syntax check run.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#SyntaxCheckerDialog.prepare">prepare</a></td> |
|
106 <td>Public method to prepare the dialog with a list of filenames.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#SyntaxCheckerDialog.start">start</a></td> |
|
109 <td>Public slot to start the syntax check.</td> |
|
110 </tr> |
|
111 </table> |
|
112 <h3>Static Methods</h3> |
|
113 <table> |
|
114 <tr><td>None</td></tr> |
|
115 </table> |
|
116 <a NAME="SyntaxCheckerDialog.__init__" ID="SyntaxCheckerDialog.__init__"></a> |
|
117 <h4>SyntaxCheckerDialog (Constructor)</h4> |
|
118 <b>SyntaxCheckerDialog</b>(<i>parent=None</i>) |
|
119 <p> |
|
120 Constructor |
|
121 </p><dl> |
|
122 <dt><i>parent</i></dt> |
|
123 <dd> |
|
124 The parent widget. (QWidget) |
|
125 </dd> |
|
126 </dl><a NAME="SyntaxCheckerDialog.__batchFinished" ID="SyntaxCheckerDialog.__batchFinished"></a> |
|
127 <h4>SyntaxCheckerDialog.__batchFinished</h4> |
|
128 <b>__batchFinished</b>(<i></i>) |
|
129 <p> |
|
130 Private slot handling the completion of a batch job. |
|
131 </p><a NAME="SyntaxCheckerDialog.__clearErrors" ID="SyntaxCheckerDialog.__clearErrors"></a> |
|
132 <h4>SyntaxCheckerDialog.__clearErrors</h4> |
|
133 <b>__clearErrors</b>(<i>files</i>) |
|
134 <p> |
|
135 Private method to clear all error and warning markers of |
|
136 open editors to be checked. |
|
137 </p><dl> |
|
138 <dt><i>files</i></dt> |
|
139 <dd> |
|
140 list of files to be checked (list of string) |
|
141 </dd> |
|
142 </dl><a NAME="SyntaxCheckerDialog.__createErrorItem" ID="SyntaxCheckerDialog.__createErrorItem"></a> |
|
143 <h4>SyntaxCheckerDialog.__createErrorItem</h4> |
|
144 <b>__createErrorItem</b>(<i>filename, message</i>) |
|
145 <p> |
|
146 Private slot to create a new error item in the result list. |
|
147 </p><dl> |
|
148 <dt><i>filename</i> (str)</dt> |
|
149 <dd> |
|
150 name of the file |
|
151 </dd><dt><i>message</i> (str)</dt> |
|
152 <dd> |
|
153 error message |
|
154 </dd> |
|
155 </dl><a NAME="SyntaxCheckerDialog.__createResultItem" ID="SyntaxCheckerDialog.__createResultItem"></a> |
|
156 <h4>SyntaxCheckerDialog.__createResultItem</h4> |
|
157 <b>__createResultItem</b>(<i>filename, line, index, error, sourcecode, isWarning=False</i>) |
|
158 <p> |
|
159 Private method to create an entry in the result list. |
|
160 </p><dl> |
|
161 <dt><i>filename</i></dt> |
|
162 <dd> |
|
163 file name of file (string) |
|
164 </dd><dt><i>line</i></dt> |
|
165 <dd> |
|
166 line number of faulty source (integer or string) |
|
167 </dd><dt><i>index</i></dt> |
|
168 <dd> |
|
169 index number of fault (integer) |
|
170 </dd><dt><i>error</i></dt> |
|
171 <dd> |
|
172 error text (string) |
|
173 </dd><dt><i>sourcecode</i></dt> |
|
174 <dd> |
|
175 faulty line of code (string) |
|
176 </dd><dt><i>isWarning</i></dt> |
|
177 <dd> |
|
178 flag indicating a warning message (boolean) |
|
179 </dd> |
|
180 </dl><a NAME="SyntaxCheckerDialog.__finish" ID="SyntaxCheckerDialog.__finish"></a> |
|
181 <h4>SyntaxCheckerDialog.__finish</h4> |
|
182 <b>__finish</b>(<i></i>) |
|
183 <p> |
|
184 Private slot called when the syntax check finished or the user |
|
185 pressed the button. |
|
186 </p><a NAME="SyntaxCheckerDialog.__processError" ID="SyntaxCheckerDialog.__processError"></a> |
|
187 <h4>SyntaxCheckerDialog.__processError</h4> |
|
188 <b>__processError</b>(<i>fn, msg</i>) |
|
189 <p> |
|
190 Private slot to process an error indication from the service. |
|
191 </p><dl> |
|
192 <dt><i>fn</i> (str)</dt> |
|
193 <dd> |
|
194 filename of the file |
|
195 </dd><dt><i>msg</i> (str)</dt> |
|
196 <dd> |
|
197 error message |
|
198 </dd> |
|
199 </dl><a NAME="SyntaxCheckerDialog.__processResult" ID="SyntaxCheckerDialog.__processResult"></a> |
|
200 <h4>SyntaxCheckerDialog.__processResult</h4> |
|
201 <b>__processResult</b>(<i>fn, problems</i>) |
|
202 <p> |
|
203 Private slot to display the reported messages. |
|
204 </p><dl> |
|
205 <dt><i>fn</i></dt> |
|
206 <dd> |
|
207 filename of the checked file (str) |
|
208 </dd><dt><i>problems</i></dt> |
|
209 <dd> |
|
210 dictionary with the keys 'error' and 'warnings' which |
|
211 hold a list containing details about the error/ warnings |
|
212 (file name, line number, column, codestring (only at syntax |
|
213 errors), the message) (dict) |
|
214 </dd> |
|
215 </dl><a NAME="SyntaxCheckerDialog.__resort" ID="SyntaxCheckerDialog.__resort"></a> |
|
216 <h4>SyntaxCheckerDialog.__resort</h4> |
|
217 <b>__resort</b>(<i></i>) |
|
218 <p> |
|
219 Private method to resort the tree. |
|
220 </p><a NAME="SyntaxCheckerDialog.check" ID="SyntaxCheckerDialog.check"></a> |
|
221 <h4>SyntaxCheckerDialog.check</h4> |
|
222 <b>check</b>(<i>codestring=''</i>) |
|
223 <p> |
|
224 Public method to start a check for one file. |
|
225 </p><p> |
|
226 The results are reported to the __processResult slot. |
|
227 </p><dl> |
|
228 <dt><i>codestring=</i></dt> |
|
229 <dd> |
|
230 optional sourcestring (str) |
|
231 </dd> |
|
232 </dl><a NAME="SyntaxCheckerDialog.checkBatch" ID="SyntaxCheckerDialog.checkBatch"></a> |
|
233 <h4>SyntaxCheckerDialog.checkBatch</h4> |
|
234 <b>checkBatch</b>(<i></i>) |
|
235 <p> |
|
236 Public method to start a style check batch job. |
|
237 </p><p> |
|
238 The results are reported to the __processResult slot. |
|
239 </p><a NAME="SyntaxCheckerDialog.on_buttonBox_clicked" ID="SyntaxCheckerDialog.on_buttonBox_clicked"></a> |
|
240 <h4>SyntaxCheckerDialog.on_buttonBox_clicked</h4> |
|
241 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
242 <p> |
|
243 Private slot called by a button of the button box clicked. |
|
244 </p><dl> |
|
245 <dt><i>button</i></dt> |
|
246 <dd> |
|
247 button that was clicked (QAbstractButton) |
|
248 </dd> |
|
249 </dl><a NAME="SyntaxCheckerDialog.on_resultList_itemActivated" ID="SyntaxCheckerDialog.on_resultList_itemActivated"></a> |
|
250 <h4>SyntaxCheckerDialog.on_resultList_itemActivated</h4> |
|
251 <b>on_resultList_itemActivated</b>(<i>itm, col</i>) |
|
252 <p> |
|
253 Private slot to handle the activation of an item. |
|
254 </p><dl> |
|
255 <dt><i>itm</i></dt> |
|
256 <dd> |
|
257 reference to the activated item (QTreeWidgetItem) |
|
258 </dd><dt><i>col</i></dt> |
|
259 <dd> |
|
260 column the item was activated in (integer) |
|
261 </dd> |
|
262 </dl><a NAME="SyntaxCheckerDialog.on_showButton_clicked" ID="SyntaxCheckerDialog.on_showButton_clicked"></a> |
|
263 <h4>SyntaxCheckerDialog.on_showButton_clicked</h4> |
|
264 <b>on_showButton_clicked</b>(<i></i>) |
|
265 <p> |
|
266 Private slot to handle the "Show" button press. |
|
267 </p><a NAME="SyntaxCheckerDialog.on_startButton_clicked" ID="SyntaxCheckerDialog.on_startButton_clicked"></a> |
|
268 <h4>SyntaxCheckerDialog.on_startButton_clicked</h4> |
|
269 <b>on_startButton_clicked</b>(<i></i>) |
|
270 <p> |
|
271 Private slot to start a syntax check run. |
|
272 </p><a NAME="SyntaxCheckerDialog.prepare" ID="SyntaxCheckerDialog.prepare"></a> |
|
273 <h4>SyntaxCheckerDialog.prepare</h4> |
|
274 <b>prepare</b>(<i>fileList, project</i>) |
|
275 <p> |
|
276 Public method to prepare the dialog with a list of filenames. |
|
277 </p><dl> |
|
278 <dt><i>fileList</i></dt> |
|
279 <dd> |
|
280 list of filenames (list of strings) |
|
281 </dd><dt><i>project</i></dt> |
|
282 <dd> |
|
283 reference to the project object (Project) |
|
284 </dd> |
|
285 </dl><a NAME="SyntaxCheckerDialog.start" ID="SyntaxCheckerDialog.start"></a> |
|
286 <h4>SyntaxCheckerDialog.start</h4> |
|
287 <b>start</b>(<i>fn, codestring=""</i>) |
|
288 <p> |
|
289 Public slot to start the syntax check. |
|
290 </p><dl> |
|
291 <dt><i>fn</i></dt> |
|
292 <dd> |
|
293 file or list of files or directory to be checked |
|
294 (string or list of strings) |
|
295 </dd><dt><i>codestring</i></dt> |
|
296 <dd> |
|
297 string containing the code to be checked (string). |
|
298 If this is given, fn must be a single file name. |
|
299 </dd> |
|
300 </dl> |
|
301 <div align="right"><a href="#top">Up</a></div> |
|
302 <hr /> |
|
303 </body></html> |