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