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