154 Class implementing a checker for functions that can be replaced by use of |
154 Class implementing a checker for functions that can be replaced by use of |
155 the pathlib module. |
155 the pathlib module. |
156 </p> |
156 </p> |
157 |
157 |
158 <h3>Derived from</h3> |
158 <h3>Derived from</h3> |
159 None |
159 CodeStyleTopicChecker |
160 <h3>Class Attributes</h3> |
160 <h3>Class Attributes</h3> |
161 <table> |
161 <table> |
|
162 <tr><td>Category</td></tr> |
162 <tr><td>Codes</td></tr> |
163 <tr><td>Codes</td></tr> |
163 <tr><td>Function2Code</td></tr> |
164 <tr><td>Function2Code</td></tr> |
164 </table> |
165 </table> |
165 |
166 |
166 <h3>Class Methods</h3> |
167 <h3>Class Methods</h3> |
177 <tr> |
178 <tr> |
178 <td><a href="#PathlibChecker.__checkForReplacement">__checkForReplacement</a></td> |
179 <td><a href="#PathlibChecker.__checkForReplacement">__checkForReplacement</a></td> |
179 <td>Private method to check the given node for the need for a replacement.</td> |
180 <td>Private method to check the given node for the need for a replacement.</td> |
180 </tr> |
181 </tr> |
181 <tr> |
182 <tr> |
182 <td><a href="#PathlibChecker.__error">__error</a></td> |
183 <td><a href="#PathlibChecker.__checkPathlibReplacement">__checkPathlibReplacement</a></td> |
183 <td>Private method to record an issue.</td> |
184 <td>Private method to check for pathlib replacements.</td> |
184 </tr> |
|
185 <tr> |
|
186 <td><a href="#PathlibChecker.__ignoreCode">__ignoreCode</a></td> |
|
187 <td>Private method to check if the message code should be ignored.</td> |
|
188 </tr> |
|
189 <tr> |
|
190 <td><a href="#PathlibChecker.run">run</a></td> |
|
191 <td>Public method to check the given source against functions to be replaced by 'pathlib' equivalents.</td> |
|
192 </tr> |
185 </tr> |
193 </table> |
186 </table> |
194 |
187 |
195 <h3>Static Methods</h3> |
188 <h3>Static Methods</h3> |
196 <table> |
189 <table> |
253 <dt><i>name</i> (str)</dt> |
246 <dt><i>name</i> (str)</dt> |
254 <dd> |
247 <dd> |
255 resolved name of the node |
248 resolved name of the node |
256 </dd> |
249 </dd> |
257 </dl> |
250 </dl> |
258 <a NAME="PathlibChecker.__error" ID="PathlibChecker.__error"></a> |
251 <a NAME="PathlibChecker.__checkPathlibReplacement" ID="PathlibChecker.__checkPathlibReplacement"></a> |
259 <h4>PathlibChecker.__error</h4> |
252 <h4>PathlibChecker.__checkPathlibReplacement</h4> |
260 <b>__error</b>(<i>lineNumber, offset, code, *args</i>) |
253 <b>__checkPathlibReplacement</b>(<i></i>) |
261 <p> |
254 <p> |
262 Private method to record an issue. |
255 Private method to check for pathlib replacements. |
263 </p> |
|
264 |
|
265 <dl> |
|
266 |
|
267 <dt><i>lineNumber</i> (int)</dt> |
|
268 <dd> |
|
269 line number of the issue |
|
270 </dd> |
|
271 <dt><i>offset</i> (int)</dt> |
|
272 <dd> |
|
273 position within line of the issue |
|
274 </dd> |
|
275 <dt><i>code</i> (str)</dt> |
|
276 <dd> |
|
277 message code |
|
278 </dd> |
|
279 <dt><i>args</i> (list)</dt> |
|
280 <dd> |
|
281 arguments for the message |
|
282 </dd> |
|
283 </dl> |
|
284 <a NAME="PathlibChecker.__ignoreCode" ID="PathlibChecker.__ignoreCode"></a> |
|
285 <h4>PathlibChecker.__ignoreCode</h4> |
|
286 <b>__ignoreCode</b>(<i>code</i>) |
|
287 <p> |
|
288 Private method to check if the message code should be ignored. |
|
289 </p> |
|
290 |
|
291 <dl> |
|
292 |
|
293 <dt><i>code</i> (str)</dt> |
|
294 <dd> |
|
295 message code to check for |
|
296 </dd> |
|
297 </dl> |
|
298 <dl> |
|
299 <dt>Return:</dt> |
|
300 <dd> |
|
301 flag indicating to ignore the given code |
|
302 </dd> |
|
303 </dl> |
|
304 <dl> |
|
305 <dt>Return Type:</dt> |
|
306 <dd> |
|
307 bool |
|
308 </dd> |
|
309 </dl> |
|
310 <a NAME="PathlibChecker.run" ID="PathlibChecker.run"></a> |
|
311 <h4>PathlibChecker.run</h4> |
|
312 <b>run</b>(<i></i>) |
|
313 <p> |
|
314 Public method to check the given source against functions |
|
315 to be replaced by 'pathlib' equivalents. |
|
316 </p> |
256 </p> |
317 |
257 |
318 <div align="right"><a href="#top">Up</a></div> |
258 <div align="right"><a href="#top">Up</a></div> |
319 <hr /> |
259 <hr /> |
320 <hr /> |
260 <hr /> |