16 |
16 |
17 a { color: #BA6D36; } |
17 a { color: #BA6D36; } |
18 |
18 |
19 </style> |
19 </style> |
20 </head> |
20 </head> |
21 <body><a NAME="top" ID="top"></a> |
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
22 <h1>eric6.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck</h1> |
23 <h1>eric6.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing the syntax check for Python 2/3. |
26 Module implementing the syntax check for Python 2/3. |
25 </p> |
27 </p> |
26 <h3>Global Attributes</h3> |
28 <h3>Global Attributes</h3> |
|
29 |
27 <table> |
30 <table> |
28 <tr><td>VcsConflictMarkerRegExpList</td></tr> |
31 <tr><td>VcsConflictMarkerRegExpList</td></tr> |
29 </table> |
32 </table> |
30 <h3>Classes</h3> |
33 <h3>Classes</h3> |
|
34 |
31 <table> |
35 <table> |
32 <tr><td>None</td></tr> |
36 <tr><td>None</td></tr> |
33 </table> |
37 </table> |
34 <h3>Functions</h3> |
38 <h3>Functions</h3> |
|
39 |
35 <table> |
40 <table> |
|
41 |
36 <tr> |
42 <tr> |
37 <td><a href="#__syntaxAndPyflakesCheck">__syntaxAndPyflakesCheck</a></td> |
43 <td><a href="#__syntaxAndPyflakesCheck">__syntaxAndPyflakesCheck</a></td> |
38 <td>Function to compile one Python source file to Python bytecode and to perform a pyflakes check.</td> |
44 <td>Function to compile one Python source file to Python bytecode and to perform a pyflakes check.</td> |
39 </tr><tr> |
45 </tr> |
|
46 <tr> |
40 <td><a href="#extractLineFlags">extractLineFlags</a></td> |
47 <td><a href="#extractLineFlags">extractLineFlags</a></td> |
41 <td>Function to extract flags starting and ending with '__' from a line comment.</td> |
48 <td>Function to extract flags starting and ending with '__' from a line comment.</td> |
42 </tr><tr> |
49 </tr> |
|
50 <tr> |
43 <td><a href="#initBatchService">initBatchService</a></td> |
51 <td><a href="#initBatchService">initBatchService</a></td> |
44 <td>Initialize the batch service and return the entry point.</td> |
52 <td>Initialize the batch service and return the entry point.</td> |
45 </tr><tr> |
53 </tr> |
|
54 <tr> |
46 <td><a href="#initService">initService</a></td> |
55 <td><a href="#initService">initService</a></td> |
47 <td>Initialize the service and return the entry point.</td> |
56 <td>Initialize the service and return the entry point.</td> |
48 </tr><tr> |
57 </tr> |
|
58 <tr> |
49 <td><a href="#normalizeCode">normalizeCode</a></td> |
59 <td><a href="#normalizeCode">normalizeCode</a></td> |
50 <td>Function to normalize the given code.</td> |
60 <td>Function to normalize the given code.</td> |
51 </tr><tr> |
61 </tr> |
|
62 <tr> |
52 <td><a href="#syntaxAndPyflakesBatchCheck">syntaxAndPyflakesBatchCheck</a></td> |
63 <td><a href="#syntaxAndPyflakesBatchCheck">syntaxAndPyflakesBatchCheck</a></td> |
53 <td>Module function to check syntax for a batch of files.</td> |
64 <td>Module function to check syntax for a batch of files.</td> |
54 </tr><tr> |
65 </tr> |
|
66 <tr> |
55 <td><a href="#syntaxAndPyflakesCheck">syntaxAndPyflakesCheck</a></td> |
67 <td><a href="#syntaxAndPyflakesCheck">syntaxAndPyflakesCheck</a></td> |
56 <td>Function to compile one Python source file to Python bytecode and to perform a pyflakes check.</td> |
68 <td>Function to compile one Python source file to Python bytecode and to perform a pyflakes check.</td> |
57 </tr><tr> |
69 </tr> |
|
70 <tr> |
58 <td><a href="#worker">worker</a></td> |
71 <td><a href="#worker">worker</a></td> |
59 <td>Module function acting as the parallel worker for the style check.</td> |
72 <td>Module function acting as the parallel worker for the style check.</td> |
60 </tr> |
73 </tr> |
61 </table> |
74 </table> |
62 <hr /><hr /> |
75 <hr /> |
|
76 <hr /> |
63 <a NAME="__syntaxAndPyflakesCheck" ID="__syntaxAndPyflakesCheck"></a> |
77 <a NAME="__syntaxAndPyflakesCheck" ID="__syntaxAndPyflakesCheck"></a> |
64 <h2>__syntaxAndPyflakesCheck</h2> |
78 <h2>__syntaxAndPyflakesCheck</h2> |
65 <b>__syntaxAndPyflakesCheck</b>(<i>filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False</i>) |
79 <b>__syntaxAndPyflakesCheck</b>(<i>filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False</i>) |
|
80 |
66 <p> |
81 <p> |
67 Function to compile one Python source file to Python bytecode |
82 Function to compile one Python source file to Python bytecode |
68 and to perform a pyflakes check. |
83 and to perform a pyflakes check. |
69 </p><dl> |
84 </p> |
|
85 <dl> |
|
86 |
70 <dt><i>filename</i></dt> |
87 <dt><i>filename</i></dt> |
71 <dd> |
88 <dd> |
72 source filename (string) |
89 source filename (string) |
73 </dd><dt><i>codestring</i></dt> |
90 </dd> |
|
91 <dt><i>codestring</i></dt> |
74 <dd> |
92 <dd> |
75 string containing the code to compile (string) |
93 string containing the code to compile (string) |
76 </dd><dt><i>checkFlakes=</i></dt> |
94 </dd> |
|
95 <dt><i>checkFlakes=</i></dt> |
77 <dd> |
96 <dd> |
78 flag indicating to do a pyflakes check (boolean) |
97 flag indicating to do a pyflakes check (boolean) |
79 </dd><dt><i>ignoreStarImportWarnings=</i></dt> |
98 </dd> |
|
99 <dt><i>ignoreStarImportWarnings=</i></dt> |
80 <dd> |
100 <dd> |
81 flag indicating to |
101 flag indicating to |
82 ignore 'star import' warnings (boolean) |
102 ignore 'star import' warnings (boolean) |
83 </dd> |
103 </dd> |
84 </dl><dl> |
104 </dl> |
|
105 <dl> |
85 <dt>Returns:</dt> |
106 <dt>Returns:</dt> |
86 <dd> |
107 <dd> |
87 dictionary with the keys 'error' and 'warnings' which |
108 dictionary with the keys 'error' and 'warnings' which |
88 hold a list containing details about the error/ warnings |
109 hold a list containing details about the error/ warnings |
89 (file name, line number, column, codestring (only at syntax |
110 (file name, line number, column, codestring (only at syntax |
90 errors), the message, a list with arguments for the message) |
111 errors), the message, a list with arguments for the message) |
91 </dd> |
112 </dd> |
92 </dl> |
113 </dl> |
93 <div align="right"><a href="#top">Up</a></div> |
114 <div align="right"><a href="#top">Up</a></div> |
94 <hr /><hr /> |
115 <hr /> |
|
116 <hr /> |
95 <a NAME="extractLineFlags" ID="extractLineFlags"></a> |
117 <a NAME="extractLineFlags" ID="extractLineFlags"></a> |
96 <h2>extractLineFlags</h2> |
118 <h2>extractLineFlags</h2> |
97 <b>extractLineFlags</b>(<i>line, startComment="</i>) |
119 <b>extractLineFlags</b>(<i>line, startComment="</i>) |
|
120 |
98 <p> |
121 <p> |
99 Function to extract flags starting and ending with '__' from a line |
122 Function to extract flags starting and ending with '__' from a line |
100 comment. |
123 comment. |
101 </p><dl> |
124 </p> |
|
125 <dl> |
|
126 |
102 <dt><i>line</i></dt> |
127 <dt><i>line</i></dt> |
103 <dd> |
128 <dd> |
104 line to extract flags from (string) |
129 line to extract flags from (string) |
105 </dd><dt><i>startComment=</i></dt> |
130 </dd> |
|
131 <dt><i>startComment=</i></dt> |
106 <dd> |
132 <dd> |
107 string identifying the start of the comment (string) |
133 string identifying the start of the comment (string) |
108 </dd><dt><i>endComment=</i></dt> |
134 </dd> |
|
135 <dt><i>endComment=</i></dt> |
109 <dd> |
136 <dd> |
110 string identifying the end of a comment (string) |
137 string identifying the end of a comment (string) |
111 </dd><dt><i>flagsLine=</i></dt> |
138 </dd> |
|
139 <dt><i>flagsLine=</i></dt> |
112 <dd> |
140 <dd> |
113 flag indicating to check for a flags only line (bool) |
141 flag indicating to check for a flags only line (bool) |
114 </dd> |
142 </dd> |
115 </dl><dl> |
143 </dl> |
|
144 <dl> |
116 <dt>Returns:</dt> |
145 <dt>Returns:</dt> |
117 <dd> |
146 <dd> |
118 list containing the extracted flags (list of strings) |
147 list containing the extracted flags (list of strings) |
119 </dd> |
148 </dd> |
120 </dl> |
149 </dl> |
121 <div align="right"><a href="#top">Up</a></div> |
150 <div align="right"><a href="#top">Up</a></div> |
122 <hr /><hr /> |
151 <hr /> |
|
152 <hr /> |
123 <a NAME="initBatchService" ID="initBatchService"></a> |
153 <a NAME="initBatchService" ID="initBatchService"></a> |
124 <h2>initBatchService</h2> |
154 <h2>initBatchService</h2> |
125 <b>initBatchService</b>(<i></i>) |
155 <b>initBatchService</b>(<i></i>) |
|
156 |
126 <p> |
157 <p> |
127 Initialize the batch service and return the entry point. |
158 Initialize the batch service and return the entry point. |
128 </p><dl> |
159 </p> |
|
160 <dl> |
129 <dt>Returns:</dt> |
161 <dt>Returns:</dt> |
130 <dd> |
162 <dd> |
131 the entry point for the background client (function) |
163 the entry point for the background client (function) |
132 </dd> |
164 </dd> |
133 </dl> |
165 </dl> |
134 <div align="right"><a href="#top">Up</a></div> |
166 <div align="right"><a href="#top">Up</a></div> |
135 <hr /><hr /> |
167 <hr /> |
|
168 <hr /> |
136 <a NAME="initService" ID="initService"></a> |
169 <a NAME="initService" ID="initService"></a> |
137 <h2>initService</h2> |
170 <h2>initService</h2> |
138 <b>initService</b>(<i></i>) |
171 <b>initService</b>(<i></i>) |
|
172 |
139 <p> |
173 <p> |
140 Initialize the service and return the entry point. |
174 Initialize the service and return the entry point. |
141 </p><dl> |
175 </p> |
|
176 <dl> |
142 <dt>Returns:</dt> |
177 <dt>Returns:</dt> |
143 <dd> |
178 <dd> |
144 the entry point for the background client (function) |
179 the entry point for the background client (function) |
145 </dd> |
180 </dd> |
146 </dl> |
181 </dl> |
147 <div align="right"><a href="#top">Up</a></div> |
182 <div align="right"><a href="#top">Up</a></div> |
148 <hr /><hr /> |
183 <hr /> |
|
184 <hr /> |
149 <a NAME="normalizeCode" ID="normalizeCode"></a> |
185 <a NAME="normalizeCode" ID="normalizeCode"></a> |
150 <h2>normalizeCode</h2> |
186 <h2>normalizeCode</h2> |
151 <b>normalizeCode</b>(<i>codestring</i>) |
187 <b>normalizeCode</b>(<i>codestring</i>) |
|
188 |
152 <p> |
189 <p> |
153 Function to normalize the given code. |
190 Function to normalize the given code. |
154 </p><dl> |
191 </p> |
|
192 <dl> |
|
193 |
155 <dt><i>codestring</i></dt> |
194 <dt><i>codestring</i></dt> |
156 <dd> |
195 <dd> |
157 code to be normalized (string) |
196 code to be normalized (string) |
158 </dd> |
197 </dd> |
159 </dl><dl> |
198 </dl> |
|
199 <dl> |
160 <dt>Returns:</dt> |
200 <dt>Returns:</dt> |
161 <dd> |
201 <dd> |
162 normalized code (string) |
202 normalized code (string) |
163 </dd> |
203 </dd> |
164 </dl> |
204 </dl> |
165 <div align="right"><a href="#top">Up</a></div> |
205 <div align="right"><a href="#top">Up</a></div> |
166 <hr /><hr /> |
206 <hr /> |
|
207 <hr /> |
167 <a NAME="syntaxAndPyflakesBatchCheck" ID="syntaxAndPyflakesBatchCheck"></a> |
208 <a NAME="syntaxAndPyflakesBatchCheck" ID="syntaxAndPyflakesBatchCheck"></a> |
168 <h2>syntaxAndPyflakesBatchCheck</h2> |
209 <h2>syntaxAndPyflakesBatchCheck</h2> |
169 <b>syntaxAndPyflakesBatchCheck</b>(<i>argumentsList, send, fx, cancelled, maxProcesses=0</i>) |
210 <b>syntaxAndPyflakesBatchCheck</b>(<i>argumentsList, send, fx, cancelled, maxProcesses=0</i>) |
|
211 |
170 <p> |
212 <p> |
171 Module function to check syntax for a batch of files. |
213 Module function to check syntax for a batch of files. |
172 </p><dl> |
214 </p> |
|
215 <dl> |
|
216 |
173 <dt><i>argumentsList</i> (list)</dt> |
217 <dt><i>argumentsList</i> (list)</dt> |
174 <dd> |
218 <dd> |
175 list of arguments tuples as given for |
219 list of arguments tuples as given for |
176 syntaxAndPyflakesCheck |
220 syntaxAndPyflakesCheck |
177 </dd><dt><i>send</i> (func)</dt> |
221 </dd> |
|
222 <dt><i>send</i> (func)</dt> |
178 <dd> |
223 <dd> |
179 reference to send function |
224 reference to send function |
180 </dd><dt><i>fx</i> (str)</dt> |
225 </dd> |
|
226 <dt><i>fx</i> (str)</dt> |
181 <dd> |
227 <dd> |
182 registered service name |
228 registered service name |
183 </dd><dt><i>cancelled</i> (func)</dt> |
229 </dd> |
|
230 <dt><i>cancelled</i> (func)</dt> |
184 <dd> |
231 <dd> |
185 reference to function checking for a cancellation |
232 reference to function checking for a cancellation |
186 </dd><dt><i>maxProcesses</i> (int)</dt> |
233 </dd> |
|
234 <dt><i>maxProcesses</i> (int)</dt> |
187 <dd> |
235 <dd> |
188 number of processes to be used |
236 number of processes to be used |
189 </dd> |
237 </dd> |
190 </dl> |
238 </dl> |
191 <div align="right"><a href="#top">Up</a></div> |
239 <div align="right"><a href="#top">Up</a></div> |
192 <hr /><hr /> |
240 <hr /> |
|
241 <hr /> |
193 <a NAME="syntaxAndPyflakesCheck" ID="syntaxAndPyflakesCheck"></a> |
242 <a NAME="syntaxAndPyflakesCheck" ID="syntaxAndPyflakesCheck"></a> |
194 <h2>syntaxAndPyflakesCheck</h2> |
243 <h2>syntaxAndPyflakesCheck</h2> |
195 <b>syntaxAndPyflakesCheck</b>(<i>filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False</i>) |
244 <b>syntaxAndPyflakesCheck</b>(<i>filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False</i>) |
|
245 |
196 <p> |
246 <p> |
197 Function to compile one Python source file to Python bytecode |
247 Function to compile one Python source file to Python bytecode |
198 and to perform a pyflakes check. |
248 and to perform a pyflakes check. |
199 </p><dl> |
249 </p> |
|
250 <dl> |
|
251 |
200 <dt><i>filename</i></dt> |
252 <dt><i>filename</i></dt> |
201 <dd> |
253 <dd> |
202 source filename (string) |
254 source filename (string) |
203 </dd><dt><i>codestring</i></dt> |
255 </dd> |
|
256 <dt><i>codestring</i></dt> |
204 <dd> |
257 <dd> |
205 string containing the code to compile (string) |
258 string containing the code to compile (string) |
206 </dd><dt><i>checkFlakes=</i></dt> |
259 </dd> |
|
260 <dt><i>checkFlakes=</i></dt> |
207 <dd> |
261 <dd> |
208 flag indicating to do a pyflakes check (boolean) |
262 flag indicating to do a pyflakes check (boolean) |
209 </dd><dt><i>ignoreStarImportWarnings=</i></dt> |
263 </dd> |
|
264 <dt><i>ignoreStarImportWarnings=</i></dt> |
210 <dd> |
265 <dd> |
211 flag indicating to |
266 flag indicating to |
212 ignore 'star import' warnings (boolean) |
267 ignore 'star import' warnings (boolean) |
213 </dd> |
268 </dd> |
214 </dl><dl> |
269 </dl> |
|
270 <dl> |
215 <dt>Returns:</dt> |
271 <dt>Returns:</dt> |
216 <dd> |
272 <dd> |
217 dictionary with the keys 'error' and 'warnings' which |
273 dictionary with the keys 'error' and 'warnings' which |
218 hold a list containing details about the error/ warnings |
274 hold a list containing details about the error/ warnings |
219 (file name, line number, column, codestring (only at syntax |
275 (file name, line number, column, codestring (only at syntax |
220 errors), the message, a list with arguments for the message) |
276 errors), the message, a list with arguments for the message) |
221 </dd> |
277 </dd> |
222 </dl> |
278 </dl> |
223 <div align="right"><a href="#top">Up</a></div> |
279 <div align="right"><a href="#top">Up</a></div> |
224 <hr /><hr /> |
280 <hr /> |
|
281 <hr /> |
225 <a NAME="worker" ID="worker"></a> |
282 <a NAME="worker" ID="worker"></a> |
226 <h2>worker</h2> |
283 <h2>worker</h2> |
227 <b>worker</b>(<i>inputQueue, outputQueue</i>) |
284 <b>worker</b>(<i>inputQueue, outputQueue</i>) |
|
285 |
228 <p> |
286 <p> |
229 Module function acting as the parallel worker for the style check. |
287 Module function acting as the parallel worker for the style check. |
230 </p><dl> |
288 </p> |
|
289 <dl> |
|
290 |
231 <dt><i>inputQueue</i></dt> |
291 <dt><i>inputQueue</i></dt> |
232 <dd> |
292 <dd> |
233 input queue (multiprocessing.Queue) |
293 input queue (multiprocessing.Queue) |
234 </dd><dt><i>outputQueue</i></dt> |
294 </dd> |
|
295 <dt><i>outputQueue</i></dt> |
235 <dd> |
296 <dd> |
236 output queue (multiprocessing.Queue) |
297 output queue (multiprocessing.Queue) |
237 </dd> |
298 </dd> |
238 </dl> |
299 </dl> |
239 <div align="right"><a href="#top">Up</a></div> |
300 <div align="right"><a href="#top">Up</a></div> |