198 <tr> |
198 <tr> |
199 <td><a href="#PathlibChecker.__error">__error</a></td> |
199 <td><a href="#PathlibChecker.__error">__error</a></td> |
200 <td>Private method to record an issue.</td> |
200 <td>Private method to record an issue.</td> |
201 </tr> |
201 </tr> |
202 <tr> |
202 <tr> |
203 <td><a href="#PathlibChecker.__generateTree">__generateTree</a></td> |
|
204 <td>Private method to generate an AST for our source.</td> |
|
205 </tr> |
|
206 <tr> |
|
207 <td><a href="#PathlibChecker.__ignoreCode">__ignoreCode</a></td> |
203 <td><a href="#PathlibChecker.__ignoreCode">__ignoreCode</a></td> |
208 <td>Private method to check if the message code should be ignored.</td> |
204 <td>Private method to check if the message code should be ignored.</td> |
209 </tr> |
205 </tr> |
210 <tr> |
206 <tr> |
211 <td><a href="#PathlibChecker.__reportInvalidSyntax">__reportInvalidSyntax</a></td> |
|
212 <td>Private method to report a syntax error.</td> |
|
213 </tr> |
|
214 <tr> |
|
215 <td><a href="#PathlibChecker.run">run</a></td> |
207 <td><a href="#PathlibChecker.run">run</a></td> |
216 <td>Public method to check the given source against functions to be replaced by 'pathlib' equivalents.</td> |
208 <td>Public method to check the given source against functions to be replaced by 'pathlib' equivalents.</td> |
217 </tr> |
209 </tr> |
218 </table> |
210 </table> |
219 <h3>Static Methods</h3> |
211 <h3>Static Methods</h3> |
222 <tr><td>None</td></tr> |
214 <tr><td>None</td></tr> |
223 </table> |
215 </table> |
224 |
216 |
225 <a NAME="PathlibChecker.__init__" ID="PathlibChecker.__init__"></a> |
217 <a NAME="PathlibChecker.__init__" ID="PathlibChecker.__init__"></a> |
226 <h4>PathlibChecker (Constructor)</h4> |
218 <h4>PathlibChecker (Constructor)</h4> |
227 <b>PathlibChecker</b>(<i>source, filename, selected, ignored, expected, repeat</i>) |
219 <b>PathlibChecker</b>(<i>source, filename, tree, selected, ignored, expected, repeat</i>) |
228 |
220 |
229 <p> |
221 <p> |
230 Constructor |
222 Constructor |
231 </p> |
223 </p> |
232 <dl> |
224 <dl> |
236 source code to be checked |
228 source code to be checked |
237 </dd> |
229 </dd> |
238 <dt><i>filename</i> (str)</dt> |
230 <dt><i>filename</i> (str)</dt> |
239 <dd> |
231 <dd> |
240 name of the source file |
232 name of the source file |
|
233 </dd> |
|
234 <dt><i>tree</i> (ast.Module)</dt> |
|
235 <dd> |
|
236 AST tree of the source code |
241 </dd> |
237 </dd> |
242 <dt><i>selected</i> (list of str)</dt> |
238 <dt><i>selected</i> (list of str)</dt> |
243 <dd> |
239 <dd> |
244 list of selected codes |
240 list of selected codes |
245 </dd> |
241 </dd> |
299 <dt><i>args</i> (list)</dt> |
295 <dt><i>args</i> (list)</dt> |
300 <dd> |
296 <dd> |
301 arguments for the message |
297 arguments for the message |
302 </dd> |
298 </dd> |
303 </dl> |
299 </dl> |
304 <a NAME="PathlibChecker.__generateTree" ID="PathlibChecker.__generateTree"></a> |
|
305 <h4>PathlibChecker.__generateTree</h4> |
|
306 <b>__generateTree</b>(<i></i>) |
|
307 |
|
308 <p> |
|
309 Private method to generate an AST for our source. |
|
310 </p> |
|
311 <dl> |
|
312 <dt>Return:</dt> |
|
313 <dd> |
|
314 generated AST |
|
315 </dd> |
|
316 </dl> |
|
317 <dl> |
|
318 <dt>Return Type:</dt> |
|
319 <dd> |
|
320 ast.AST |
|
321 </dd> |
|
322 </dl> |
|
323 <a NAME="PathlibChecker.__ignoreCode" ID="PathlibChecker.__ignoreCode"></a> |
300 <a NAME="PathlibChecker.__ignoreCode" ID="PathlibChecker.__ignoreCode"></a> |
324 <h4>PathlibChecker.__ignoreCode</h4> |
301 <h4>PathlibChecker.__ignoreCode</h4> |
325 <b>__ignoreCode</b>(<i>code</i>) |
302 <b>__ignoreCode</b>(<i>code</i>) |
326 |
303 |
327 <p> |
304 <p> |
344 <dt>Return Type:</dt> |
321 <dt>Return Type:</dt> |
345 <dd> |
322 <dd> |
346 bool |
323 bool |
347 </dd> |
324 </dd> |
348 </dl> |
325 </dl> |
349 <a NAME="PathlibChecker.__reportInvalidSyntax" ID="PathlibChecker.__reportInvalidSyntax"></a> |
|
350 <h4>PathlibChecker.__reportInvalidSyntax</h4> |
|
351 <b>__reportInvalidSyntax</b>(<i></i>) |
|
352 |
|
353 <p> |
|
354 Private method to report a syntax error. |
|
355 </p> |
|
356 <a NAME="PathlibChecker.run" ID="PathlibChecker.run"></a> |
326 <a NAME="PathlibChecker.run" ID="PathlibChecker.run"></a> |
357 <h4>PathlibChecker.run</h4> |
327 <h4>PathlibChecker.run</h4> |
358 <b>run</b>(<i></i>) |
328 <b>run</b>(<i></i>) |
359 |
329 |
360 <p> |
330 <p> |