|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.PluginSyntaxChecker</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.Plugins.PluginSyntaxChecker</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the Syntax Checker plugin. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>author</td></tr><tr><td>autoactivate</td></tr><tr><td>className</td></tr><tr><td>deactivateable</td></tr><tr><td>error</td></tr><tr><td>longDescription</td></tr><tr><td>name</td></tr><tr><td>packageName</td></tr><tr><td>pyqtApi</td></tr><tr><td>shortDescription</td></tr><tr><td>version</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#SyntaxCheckerPlugin">SyntaxCheckerPlugin</a></td> |
|
25 <td>Class implementing the Syntax Checker plugin.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="SyntaxCheckerPlugin" ID="SyntaxCheckerPlugin"></a> |
|
36 <h2>SyntaxCheckerPlugin</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing the Syntax Checker plugin. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 QObject |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#SyntaxCheckerPlugin.__init__">SyntaxCheckerPlugin</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#SyntaxCheckerPlugin.__editorClosed">__editorClosed</a></td> |
|
63 <td>Private slot called, when an editor was closed.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#SyntaxCheckerPlugin.__editorOpened">__editorOpened</a></td> |
|
67 <td>Private slot called, when a new editor was opened.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#SyntaxCheckerPlugin.__editorShowMenu">__editorShowMenu</a></td> |
|
71 <td>Private slot called, when the the editor context menu or a submenu is about to be shown.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#SyntaxCheckerPlugin.__editorSyntaxCheck">__editorSyntaxCheck</a></td> |
|
75 <td>Private slot to handle the syntax check context menu action of the editors.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#SyntaxCheckerPlugin.__getPythonOptions">__getPythonOptions</a></td> |
|
79 <td>Private method to determine the syntax check options.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#SyntaxCheckerPlugin.__initialize">__initialize</a></td> |
|
83 <td>Private slot to (re)initialize the plugin.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#SyntaxCheckerPlugin.__projectBrowserShowMenu">__projectBrowserShowMenu</a></td> |
|
87 <td>Private slot called, when the the project browser menu or a submenu is about to be shown.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#SyntaxCheckerPlugin.__projectBrowserSyntaxCheck">__projectBrowserSyntaxCheck</a></td> |
|
91 <td>Private method to handle the syntax check context menu action of the project sources browser.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#SyntaxCheckerPlugin.__projectShowMenu">__projectShowMenu</a></td> |
|
95 <td>Private slot called, when the the project menu or a submenu is about to be shown.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#SyntaxCheckerPlugin.__projectSyntaxCheck">__projectSyntaxCheck</a></td> |
|
99 <td>Private slot used to check the project files for syntax errors.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#SyntaxCheckerPlugin.__translateSyntaxCheck">__translateSyntaxCheck</a></td> |
|
103 <td>Private slot to translate the resulting messages.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#SyntaxCheckerPlugin.activate">activate</a></td> |
|
107 <td>Public method to activate this plugin.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#SyntaxCheckerPlugin.deactivate">deactivate</a></td> |
|
111 <td>Public method to deactivate this plugin.</td> |
|
112 </tr> |
|
113 </table> |
|
114 <h3>Static Methods</h3> |
|
115 |
|
116 <table> |
|
117 <tr><td>None</td></tr> |
|
118 </table> |
|
119 |
|
120 <a NAME="SyntaxCheckerPlugin.__init__" ID="SyntaxCheckerPlugin.__init__"></a> |
|
121 <h4>SyntaxCheckerPlugin (Constructor)</h4> |
|
122 <b>SyntaxCheckerPlugin</b>(<i>ui</i>) |
|
123 |
|
124 <p> |
|
125 Constructor |
|
126 </p> |
|
127 <dl> |
|
128 |
|
129 <dt><i>ui</i></dt> |
|
130 <dd> |
|
131 reference to the user interface object (UI.UserInterface) |
|
132 </dd> |
|
133 </dl> |
|
134 <a NAME="SyntaxCheckerPlugin.__editorClosed" ID="SyntaxCheckerPlugin.__editorClosed"></a> |
|
135 <h4>SyntaxCheckerPlugin.__editorClosed</h4> |
|
136 <b>__editorClosed</b>(<i>editor</i>) |
|
137 |
|
138 <p> |
|
139 Private slot called, when an editor was closed. |
|
140 </p> |
|
141 <dl> |
|
142 |
|
143 <dt><i>editor</i></dt> |
|
144 <dd> |
|
145 reference to the editor (QScintilla.Editor) |
|
146 </dd> |
|
147 </dl> |
|
148 <a NAME="SyntaxCheckerPlugin.__editorOpened" ID="SyntaxCheckerPlugin.__editorOpened"></a> |
|
149 <h4>SyntaxCheckerPlugin.__editorOpened</h4> |
|
150 <b>__editorOpened</b>(<i>editor</i>) |
|
151 |
|
152 <p> |
|
153 Private slot called, when a new editor was opened. |
|
154 </p> |
|
155 <dl> |
|
156 |
|
157 <dt><i>editor</i></dt> |
|
158 <dd> |
|
159 reference to the new editor (QScintilla.Editor) |
|
160 </dd> |
|
161 </dl> |
|
162 <a NAME="SyntaxCheckerPlugin.__editorShowMenu" ID="SyntaxCheckerPlugin.__editorShowMenu"></a> |
|
163 <h4>SyntaxCheckerPlugin.__editorShowMenu</h4> |
|
164 <b>__editorShowMenu</b>(<i>menuName, menu, editor</i>) |
|
165 |
|
166 <p> |
|
167 Private slot called, when the the editor context menu or a submenu is |
|
168 about to be shown. |
|
169 </p> |
|
170 <dl> |
|
171 |
|
172 <dt><i>menuName</i></dt> |
|
173 <dd> |
|
174 name of the menu to be shown (string) |
|
175 </dd> |
|
176 <dt><i>menu</i></dt> |
|
177 <dd> |
|
178 reference to the menu (QMenu) |
|
179 </dd> |
|
180 <dt><i>editor</i></dt> |
|
181 <dd> |
|
182 reference to the editor |
|
183 </dd> |
|
184 </dl> |
|
185 <a NAME="SyntaxCheckerPlugin.__editorSyntaxCheck" ID="SyntaxCheckerPlugin.__editorSyntaxCheck"></a> |
|
186 <h4>SyntaxCheckerPlugin.__editorSyntaxCheck</h4> |
|
187 <b>__editorSyntaxCheck</b>(<i></i>) |
|
188 |
|
189 <p> |
|
190 Private slot to handle the syntax check context menu action of the |
|
191 editors. |
|
192 </p> |
|
193 <a NAME="SyntaxCheckerPlugin.__getPythonOptions" ID="SyntaxCheckerPlugin.__getPythonOptions"></a> |
|
194 <h4>SyntaxCheckerPlugin.__getPythonOptions</h4> |
|
195 <b>__getPythonOptions</b>(<i></i>) |
|
196 |
|
197 <p> |
|
198 Private method to determine the syntax check options. |
|
199 </p> |
|
200 <dl> |
|
201 <dt>Return:</dt> |
|
202 <dd> |
|
203 state of checkFlakes and ignoreStarImportWarnings (bool, bool) |
|
204 </dd> |
|
205 </dl> |
|
206 <a NAME="SyntaxCheckerPlugin.__initialize" ID="SyntaxCheckerPlugin.__initialize"></a> |
|
207 <h4>SyntaxCheckerPlugin.__initialize</h4> |
|
208 <b>__initialize</b>(<i></i>) |
|
209 |
|
210 <p> |
|
211 Private slot to (re)initialize the plugin. |
|
212 </p> |
|
213 <a NAME="SyntaxCheckerPlugin.__projectBrowserShowMenu" ID="SyntaxCheckerPlugin.__projectBrowserShowMenu"></a> |
|
214 <h4>SyntaxCheckerPlugin.__projectBrowserShowMenu</h4> |
|
215 <b>__projectBrowserShowMenu</b>(<i>menuName, menu</i>) |
|
216 |
|
217 <p> |
|
218 Private slot called, when the the project browser menu or a submenu is |
|
219 about to be shown. |
|
220 </p> |
|
221 <dl> |
|
222 |
|
223 <dt><i>menuName</i></dt> |
|
224 <dd> |
|
225 name of the menu to be shown (string) |
|
226 </dd> |
|
227 <dt><i>menu</i></dt> |
|
228 <dd> |
|
229 reference to the menu (QMenu) |
|
230 </dd> |
|
231 </dl> |
|
232 <a NAME="SyntaxCheckerPlugin.__projectBrowserSyntaxCheck" ID="SyntaxCheckerPlugin.__projectBrowserSyntaxCheck"></a> |
|
233 <h4>SyntaxCheckerPlugin.__projectBrowserSyntaxCheck</h4> |
|
234 <b>__projectBrowserSyntaxCheck</b>(<i></i>) |
|
235 |
|
236 <p> |
|
237 Private method to handle the syntax check context menu action of the |
|
238 project sources browser. |
|
239 </p> |
|
240 <a NAME="SyntaxCheckerPlugin.__projectShowMenu" ID="SyntaxCheckerPlugin.__projectShowMenu"></a> |
|
241 <h4>SyntaxCheckerPlugin.__projectShowMenu</h4> |
|
242 <b>__projectShowMenu</b>(<i>menuName, menu</i>) |
|
243 |
|
244 <p> |
|
245 Private slot called, when the the project menu or a submenu is |
|
246 about to be shown. |
|
247 </p> |
|
248 <dl> |
|
249 |
|
250 <dt><i>menuName</i></dt> |
|
251 <dd> |
|
252 name of the menu to be shown (string) |
|
253 </dd> |
|
254 <dt><i>menu</i></dt> |
|
255 <dd> |
|
256 reference to the menu (QMenu) |
|
257 </dd> |
|
258 </dl> |
|
259 <a NAME="SyntaxCheckerPlugin.__projectSyntaxCheck" ID="SyntaxCheckerPlugin.__projectSyntaxCheck"></a> |
|
260 <h4>SyntaxCheckerPlugin.__projectSyntaxCheck</h4> |
|
261 <b>__projectSyntaxCheck</b>(<i></i>) |
|
262 |
|
263 <p> |
|
264 Private slot used to check the project files for syntax errors. |
|
265 </p> |
|
266 <a NAME="SyntaxCheckerPlugin.__translateSyntaxCheck" ID="SyntaxCheckerPlugin.__translateSyntaxCheck"></a> |
|
267 <h4>SyntaxCheckerPlugin.__translateSyntaxCheck</h4> |
|
268 <b>__translateSyntaxCheck</b>(<i>fn, problems</i>) |
|
269 |
|
270 <p> |
|
271 Private slot to translate the resulting messages. |
|
272 </p> |
|
273 <p> |
|
274 If checkFlakes is True, warnings contains a list of strings containing |
|
275 the warnings (marker, file name, line number, message) |
|
276 The values are only valid, if nok is False. |
|
277 </p> |
|
278 <dl> |
|
279 |
|
280 <dt><i>fn</i></dt> |
|
281 <dd> |
|
282 filename of the checked file (str) |
|
283 </dd> |
|
284 <dt><i>problems</i></dt> |
|
285 <dd> |
|
286 dictionary with the keys 'error' and 'warnings' which |
|
287 hold a list containing details about the error/ warnings |
|
288 (file name, line number, column, codestring (only at syntax |
|
289 errors), the message, a list with arguments for the message) |
|
290 </dd> |
|
291 </dl> |
|
292 <a NAME="SyntaxCheckerPlugin.activate" ID="SyntaxCheckerPlugin.activate"></a> |
|
293 <h4>SyntaxCheckerPlugin.activate</h4> |
|
294 <b>activate</b>(<i></i>) |
|
295 |
|
296 <p> |
|
297 Public method to activate this plugin. |
|
298 </p> |
|
299 <dl> |
|
300 <dt>Return:</dt> |
|
301 <dd> |
|
302 tuple of None and activation status (boolean) |
|
303 </dd> |
|
304 </dl> |
|
305 <a NAME="SyntaxCheckerPlugin.deactivate" ID="SyntaxCheckerPlugin.deactivate"></a> |
|
306 <h4>SyntaxCheckerPlugin.deactivate</h4> |
|
307 <b>deactivate</b>(<i></i>) |
|
308 |
|
309 <p> |
|
310 Public method to deactivate this plugin. |
|
311 </p> |
|
312 <div align="right"><a href="#top">Up</a></div> |
|
313 <hr /> |
|
314 </body></html> |