|
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.__clearErrors">__clearErrors</a></td> |
|
64 <td>Private method to clear all error and warning markers of open editors to be checked.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#SyntaxCheckerDialog.__createResultItem">__createResultItem</a></td> |
|
67 <td>Private method to create an entry in the result list.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#SyntaxCheckerDialog.__finish">__finish</a></td> |
|
70 <td>Private slot called when the syntax check finished or the user pressed the button.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#SyntaxCheckerDialog.__processResult">__processResult</a></td> |
|
73 <td>Private slot to display the reported messages.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#SyntaxCheckerDialog.__resort">__resort</a></td> |
|
76 <td>Private method to resort the tree.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#SyntaxCheckerDialog.check">check</a></td> |
|
79 <td>Public method to start a check for one file.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#SyntaxCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
82 <td>Private slot called by a button of the button box clicked.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#SyntaxCheckerDialog.on_resultList_itemActivated">on_resultList_itemActivated</a></td> |
|
85 <td>Private slot to handle the activation of an item.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#SyntaxCheckerDialog.on_showButton_clicked">on_showButton_clicked</a></td> |
|
88 <td>Private slot to handle the "Show" button press.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#SyntaxCheckerDialog.on_startButton_clicked">on_startButton_clicked</a></td> |
|
91 <td>Private slot to start a syntax check run.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#SyntaxCheckerDialog.prepare">prepare</a></td> |
|
94 <td>Public method to prepare the dialog with a list of filenames.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#SyntaxCheckerDialog.start">start</a></td> |
|
97 <td>Public slot to start the syntax check.</td> |
|
98 </tr> |
|
99 </table> |
|
100 <h3>Static Methods</h3> |
|
101 <table> |
|
102 <tr><td>None</td></tr> |
|
103 </table> |
|
104 <a NAME="SyntaxCheckerDialog.__init__" ID="SyntaxCheckerDialog.__init__"></a> |
|
105 <h4>SyntaxCheckerDialog (Constructor)</h4> |
|
106 <b>SyntaxCheckerDialog</b>(<i>parent=None</i>) |
|
107 <p> |
|
108 Constructor |
|
109 </p><dl> |
|
110 <dt><i>parent</i></dt> |
|
111 <dd> |
|
112 The parent widget. (QWidget) |
|
113 </dd> |
|
114 </dl><a NAME="SyntaxCheckerDialog.__clearErrors" ID="SyntaxCheckerDialog.__clearErrors"></a> |
|
115 <h4>SyntaxCheckerDialog.__clearErrors</h4> |
|
116 <b>__clearErrors</b>(<i>files</i>) |
|
117 <p> |
|
118 Private method to clear all error and warning markers of |
|
119 open editors to be checked. |
|
120 </p><dl> |
|
121 <dt><i>files</i></dt> |
|
122 <dd> |
|
123 list of files to be checked (list of string) |
|
124 </dd> |
|
125 </dl><a NAME="SyntaxCheckerDialog.__createResultItem" ID="SyntaxCheckerDialog.__createResultItem"></a> |
|
126 <h4>SyntaxCheckerDialog.__createResultItem</h4> |
|
127 <b>__createResultItem</b>(<i>file, line, index, error, sourcecode, isWarning=False</i>) |
|
128 <p> |
|
129 Private method to create an entry in the result list. |
|
130 </p><dl> |
|
131 <dt><i>file</i></dt> |
|
132 <dd> |
|
133 file name of file (string) |
|
134 </dd><dt><i>line</i></dt> |
|
135 <dd> |
|
136 line number of faulty source (integer or string) |
|
137 </dd><dt><i>index</i></dt> |
|
138 <dd> |
|
139 index number of fault (integer) |
|
140 </dd><dt><i>error</i></dt> |
|
141 <dd> |
|
142 error text (string) |
|
143 </dd><dt><i>sourcecode</i></dt> |
|
144 <dd> |
|
145 faulty line of code (string) |
|
146 </dd><dt><i>isWarning</i></dt> |
|
147 <dd> |
|
148 flag indicating a warning message (boolean) |
|
149 </dd> |
|
150 </dl><a NAME="SyntaxCheckerDialog.__finish" ID="SyntaxCheckerDialog.__finish"></a> |
|
151 <h4>SyntaxCheckerDialog.__finish</h4> |
|
152 <b>__finish</b>(<i></i>) |
|
153 <p> |
|
154 Private slot called when the syntax check finished or the user |
|
155 pressed the button. |
|
156 </p><a NAME="SyntaxCheckerDialog.__processResult" ID="SyntaxCheckerDialog.__processResult"></a> |
|
157 <h4>SyntaxCheckerDialog.__processResult</h4> |
|
158 <b>__processResult</b>(<i>fn, problems</i>) |
|
159 <p> |
|
160 Private slot to display the reported messages. |
|
161 </p><dl> |
|
162 <dt><i>fn</i></dt> |
|
163 <dd> |
|
164 filename of the checked file (str) |
|
165 </dd><dt><i>problems</i></dt> |
|
166 <dd> |
|
167 dictionary with the keys 'error' and 'warnings' which |
|
168 hold a list containing details about the error/ warnings |
|
169 (file name, line number, column, codestring (only at syntax |
|
170 errors), the message) (dict) |
|
171 </dd> |
|
172 </dl><a NAME="SyntaxCheckerDialog.__resort" ID="SyntaxCheckerDialog.__resort"></a> |
|
173 <h4>SyntaxCheckerDialog.__resort</h4> |
|
174 <b>__resort</b>(<i></i>) |
|
175 <p> |
|
176 Private method to resort the tree. |
|
177 </p><a NAME="SyntaxCheckerDialog.check" ID="SyntaxCheckerDialog.check"></a> |
|
178 <h4>SyntaxCheckerDialog.check</h4> |
|
179 <b>check</b>(<i>codestring=''</i>) |
|
180 <p> |
|
181 Public method to start a check for one file. |
|
182 </p><p> |
|
183 The results are reported to the __processResult slot. |
|
184 </p><dl> |
|
185 <dt><i>codestring=</i></dt> |
|
186 <dd> |
|
187 optional sourcestring (str) |
|
188 </dd> |
|
189 </dl><a NAME="SyntaxCheckerDialog.on_buttonBox_clicked" ID="SyntaxCheckerDialog.on_buttonBox_clicked"></a> |
|
190 <h4>SyntaxCheckerDialog.on_buttonBox_clicked</h4> |
|
191 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
192 <p> |
|
193 Private slot called by a button of the button box clicked. |
|
194 </p><dl> |
|
195 <dt><i>button</i></dt> |
|
196 <dd> |
|
197 button that was clicked (QAbstractButton) |
|
198 </dd> |
|
199 </dl><a NAME="SyntaxCheckerDialog.on_resultList_itemActivated" ID="SyntaxCheckerDialog.on_resultList_itemActivated"></a> |
|
200 <h4>SyntaxCheckerDialog.on_resultList_itemActivated</h4> |
|
201 <b>on_resultList_itemActivated</b>(<i>itm, col</i>) |
|
202 <p> |
|
203 Private slot to handle the activation of an item. |
|
204 </p><dl> |
|
205 <dt><i>itm</i></dt> |
|
206 <dd> |
|
207 reference to the activated item (QTreeWidgetItem) |
|
208 </dd><dt><i>col</i></dt> |
|
209 <dd> |
|
210 column the item was activated in (integer) |
|
211 </dd> |
|
212 </dl><a NAME="SyntaxCheckerDialog.on_showButton_clicked" ID="SyntaxCheckerDialog.on_showButton_clicked"></a> |
|
213 <h4>SyntaxCheckerDialog.on_showButton_clicked</h4> |
|
214 <b>on_showButton_clicked</b>(<i></i>) |
|
215 <p> |
|
216 Private slot to handle the "Show" button press. |
|
217 </p><a NAME="SyntaxCheckerDialog.on_startButton_clicked" ID="SyntaxCheckerDialog.on_startButton_clicked"></a> |
|
218 <h4>SyntaxCheckerDialog.on_startButton_clicked</h4> |
|
219 <b>on_startButton_clicked</b>(<i></i>) |
|
220 <p> |
|
221 Private slot to start a syntax check run. |
|
222 </p><a NAME="SyntaxCheckerDialog.prepare" ID="SyntaxCheckerDialog.prepare"></a> |
|
223 <h4>SyntaxCheckerDialog.prepare</h4> |
|
224 <b>prepare</b>(<i>fileList, project</i>) |
|
225 <p> |
|
226 Public method to prepare the dialog with a list of filenames. |
|
227 </p><dl> |
|
228 <dt><i>fileList</i></dt> |
|
229 <dd> |
|
230 list of filenames (list of strings) |
|
231 </dd><dt><i>project</i></dt> |
|
232 <dd> |
|
233 reference to the project object (Project) |
|
234 </dd> |
|
235 </dl><a NAME="SyntaxCheckerDialog.start" ID="SyntaxCheckerDialog.start"></a> |
|
236 <h4>SyntaxCheckerDialog.start</h4> |
|
237 <b>start</b>(<i>fn, codestring=""</i>) |
|
238 <p> |
|
239 Public slot to start the syntax check. |
|
240 </p><dl> |
|
241 <dt><i>fn</i></dt> |
|
242 <dd> |
|
243 file or list of files or directory to be checked |
|
244 (string or list of strings) |
|
245 </dd><dt><i>codestring</i></dt> |
|
246 <dd> |
|
247 string containing the code to be checked (string). |
|
248 If this is given, fn must be a single file name. |
|
249 </dd> |
|
250 </dl> |
|
251 <div align="right"><a href="#top">Up</a></div> |
|
252 <hr /> |
|
253 </body></html> |