75 <tr> |
75 <tr> |
76 <td><a href="#SimplifyChecker.__error">__error</a></td> |
76 <td><a href="#SimplifyChecker.__error">__error</a></td> |
77 <td>Private method to record an issue.</td> |
77 <td>Private method to record an issue.</td> |
78 </tr> |
78 </tr> |
79 <tr> |
79 <tr> |
80 <td><a href="#SimplifyChecker.__generateTree">__generateTree</a></td> |
|
81 <td>Private method to generate an AST for our source.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#SimplifyChecker.__ignoreCode">__ignoreCode</a></td> |
80 <td><a href="#SimplifyChecker.__ignoreCode">__ignoreCode</a></td> |
85 <td>Private method to check if the message code should be ignored.</td> |
81 <td>Private method to check if the message code should be ignored.</td> |
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#SimplifyChecker.__reportInvalidSyntax">__reportInvalidSyntax</a></td> |
|
89 <td>Private method to report a syntax error.</td> |
|
90 </tr> |
82 </tr> |
91 <tr> |
83 <tr> |
92 <td><a href="#SimplifyChecker.run">run</a></td> |
84 <td><a href="#SimplifyChecker.run">run</a></td> |
93 <td>Public method to check the given source against functions to be replaced by 'pathlib' equivalents.</td> |
85 <td>Public method to check the given source against functions to be replaced by 'pathlib' equivalents.</td> |
94 </tr> |
86 </tr> |
99 <tr><td>None</td></tr> |
91 <tr><td>None</td></tr> |
100 </table> |
92 </table> |
101 |
93 |
102 <a NAME="SimplifyChecker.__init__" ID="SimplifyChecker.__init__"></a> |
94 <a NAME="SimplifyChecker.__init__" ID="SimplifyChecker.__init__"></a> |
103 <h4>SimplifyChecker (Constructor)</h4> |
95 <h4>SimplifyChecker (Constructor)</h4> |
104 <b>SimplifyChecker</b>(<i>source, filename, selected, ignored, expected, repeat</i>) |
96 <b>SimplifyChecker</b>(<i>source, filename, tree, selected, ignored, expected, repeat</i>) |
105 |
97 |
106 <p> |
98 <p> |
107 Constructor |
99 Constructor |
108 </p> |
100 </p> |
109 <dl> |
101 <dl> |
113 source code to be checked |
105 source code to be checked |
114 </dd> |
106 </dd> |
115 <dt><i>filename</i> (str)</dt> |
107 <dt><i>filename</i> (str)</dt> |
116 <dd> |
108 <dd> |
117 name of the source file |
109 name of the source file |
|
110 </dd> |
|
111 <dt><i>tree</i> (ast.Module)</dt> |
|
112 <dd> |
|
113 AST tree of the source code |
118 </dd> |
114 </dd> |
119 <dt><i>selected</i> (list of str)</dt> |
115 <dt><i>selected</i> (list of str)</dt> |
120 <dd> |
116 <dd> |
121 list of selected codes |
117 list of selected codes |
122 </dd> |
118 </dd> |
157 <dt><i>args</i> (list)</dt> |
153 <dt><i>args</i> (list)</dt> |
158 <dd> |
154 <dd> |
159 arguments for the message |
155 arguments for the message |
160 </dd> |
156 </dd> |
161 </dl> |
157 </dl> |
162 <a NAME="SimplifyChecker.__generateTree" ID="SimplifyChecker.__generateTree"></a> |
|
163 <h4>SimplifyChecker.__generateTree</h4> |
|
164 <b>__generateTree</b>(<i></i>) |
|
165 |
|
166 <p> |
|
167 Private method to generate an AST for our source. |
|
168 </p> |
|
169 <dl> |
|
170 <dt>Return:</dt> |
|
171 <dd> |
|
172 generated AST |
|
173 </dd> |
|
174 </dl> |
|
175 <dl> |
|
176 <dt>Return Type:</dt> |
|
177 <dd> |
|
178 ast.AST |
|
179 </dd> |
|
180 </dl> |
|
181 <a NAME="SimplifyChecker.__ignoreCode" ID="SimplifyChecker.__ignoreCode"></a> |
158 <a NAME="SimplifyChecker.__ignoreCode" ID="SimplifyChecker.__ignoreCode"></a> |
182 <h4>SimplifyChecker.__ignoreCode</h4> |
159 <h4>SimplifyChecker.__ignoreCode</h4> |
183 <b>__ignoreCode</b>(<i>code</i>) |
160 <b>__ignoreCode</b>(<i>code</i>) |
184 |
161 |
185 <p> |
162 <p> |
202 <dt>Return Type:</dt> |
179 <dt>Return Type:</dt> |
203 <dd> |
180 <dd> |
204 bool |
181 bool |
205 </dd> |
182 </dd> |
206 </dl> |
183 </dl> |
207 <a NAME="SimplifyChecker.__reportInvalidSyntax" ID="SimplifyChecker.__reportInvalidSyntax"></a> |
|
208 <h4>SimplifyChecker.__reportInvalidSyntax</h4> |
|
209 <b>__reportInvalidSyntax</b>(<i></i>) |
|
210 |
|
211 <p> |
|
212 Private method to report a syntax error. |
|
213 </p> |
|
214 <a NAME="SimplifyChecker.run" ID="SimplifyChecker.run"></a> |
184 <a NAME="SimplifyChecker.run" ID="SimplifyChecker.run"></a> |
215 <h4>SimplifyChecker.run</h4> |
185 <h4>SimplifyChecker.run</h4> |
216 <b>run</b>(<i></i>) |
186 <b>run</b>(<i></i>) |
217 |
187 |
218 <p> |
188 <p> |