src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.SyntaxChecker.pyCheckSyntax.html

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

eric ide

mercurial