|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.eradicate</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> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.eradicate</h1> |
|
24 |
|
25 <p> |
|
26 Removes commented-out Python code. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>__version__</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#Eradicator">Eradicator</a></td> |
|
39 <td>Eradicate comments.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 |
|
46 <tr> |
|
47 <td><a href="#main">main</a></td> |
|
48 <td>Main entry point.</td> |
|
49 </tr> |
|
50 </table> |
|
51 <hr /> |
|
52 <hr /> |
|
53 <a NAME="Eradicator" ID="Eradicator"></a> |
|
54 <h2>Eradicator</h2> |
|
55 |
|
56 <p> |
|
57 Eradicate comments. |
|
58 </p> |
|
59 <h3>Derived from</h3> |
|
60 object |
|
61 <h3>Class Attributes</h3> |
|
62 |
|
63 <table> |
|
64 <tr><td>BRACKET_REGEX</td></tr><tr><td>CODE_INDICATORS</td></tr><tr><td>CODE_KEYWORDS</td></tr><tr><td>CODE_KEYWORDS_AGGR</td></tr><tr><td>CODING_COMMENT_REGEX</td></tr><tr><td>DEFAULT_WHITELIST</td></tr><tr><td>DEF_STATEMENT_REGEX</td></tr><tr><td>FOR_STATEMENT_REGEX</td></tr><tr><td>HASH_NUMBER</td></tr><tr><td>MULTILINE_ASSIGNMENT_REGEX</td></tr><tr><td>PARTIAL_DICTIONARY_REGEX</td></tr><tr><td>PRINT_RETURN_REGEX</td></tr><tr><td>WHITELIST_REGEX</td></tr><tr><td>WHITESPACE_HASH</td></tr><tr><td>WITH_STATEMENT_REGEX</td></tr> |
|
65 </table> |
|
66 <h3>Class Methods</h3> |
|
67 |
|
68 <table> |
|
69 <tr><td>None</td></tr> |
|
70 </table> |
|
71 <h3>Methods</h3> |
|
72 |
|
73 <table> |
|
74 |
|
75 <tr> |
|
76 <td><a href="#Eradicator.comment_contains_code">comment_contains_code</a></td> |
|
77 <td>Return True comment contains code.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#Eradicator.commented_out_code_line_numbers">commented_out_code_line_numbers</a></td> |
|
81 <td>Yield line numbers of commented-out code.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#Eradicator.detect_encoding">detect_encoding</a></td> |
|
85 <td>Return file encoding.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#Eradicator.filter_commented_out_code">filter_commented_out_code</a></td> |
|
89 <td>Yield code with commented out code removed.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#Eradicator.fix_file">fix_file</a></td> |
|
93 <td>Run filter_commented_out_code() on file.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#Eradicator.multiline_case">multiline_case</a></td> |
|
97 <td>Return True if line is probably part of some multiline code.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#Eradicator.open_with_encoding">open_with_encoding</a></td> |
|
101 <td>Return opened file with a specific encoding.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#Eradicator.update_whitelist">update_whitelist</a></td> |
|
105 <td>Updates the whitelist.</td> |
|
106 </tr> |
|
107 </table> |
|
108 <h3>Static Methods</h3> |
|
109 |
|
110 <table> |
|
111 <tr><td>None</td></tr> |
|
112 </table> |
|
113 |
|
114 <a NAME="Eradicator.comment_contains_code" ID="Eradicator.comment_contains_code"></a> |
|
115 <h4>Eradicator.comment_contains_code</h4> |
|
116 <b>comment_contains_code</b>(<i>line, aggressive=True</i>) |
|
117 |
|
118 <p> |
|
119 Return True comment contains code. |
|
120 </p> |
|
121 <a NAME="Eradicator.commented_out_code_line_numbers" ID="Eradicator.commented_out_code_line_numbers"></a> |
|
122 <h4>Eradicator.commented_out_code_line_numbers</h4> |
|
123 <b>commented_out_code_line_numbers</b>(<i>source, aggressive=True</i>) |
|
124 |
|
125 <p> |
|
126 Yield line numbers of commented-out code. |
|
127 </p> |
|
128 <a NAME="Eradicator.detect_encoding" ID="Eradicator.detect_encoding"></a> |
|
129 <h4>Eradicator.detect_encoding</h4> |
|
130 <b>detect_encoding</b>(<i>filename</i>) |
|
131 |
|
132 <p> |
|
133 Return file encoding. |
|
134 </p> |
|
135 <a NAME="Eradicator.filter_commented_out_code" ID="Eradicator.filter_commented_out_code"></a> |
|
136 <h4>Eradicator.filter_commented_out_code</h4> |
|
137 <b>filter_commented_out_code</b>(<i>source, aggressive=True</i>) |
|
138 |
|
139 <p> |
|
140 Yield code with commented out code removed. |
|
141 </p> |
|
142 <a NAME="Eradicator.fix_file" ID="Eradicator.fix_file"></a> |
|
143 <h4>Eradicator.fix_file</h4> |
|
144 <b>fix_file</b>(<i>filename, args, standard_out</i>) |
|
145 |
|
146 <p> |
|
147 Run filter_commented_out_code() on file. |
|
148 </p> |
|
149 <a NAME="Eradicator.multiline_case" ID="Eradicator.multiline_case"></a> |
|
150 <h4>Eradicator.multiline_case</h4> |
|
151 <b>multiline_case</b>(<i>line, aggressive=True</i>) |
|
152 |
|
153 <p> |
|
154 Return True if line is probably part of some multiline code. |
|
155 </p> |
|
156 <a NAME="Eradicator.open_with_encoding" ID="Eradicator.open_with_encoding"></a> |
|
157 <h4>Eradicator.open_with_encoding</h4> |
|
158 <b>open_with_encoding</b>(<i>filename, encoding, mode='r'</i>) |
|
159 |
|
160 <p> |
|
161 Return opened file with a specific encoding. |
|
162 </p> |
|
163 <a NAME="Eradicator.update_whitelist" ID="Eradicator.update_whitelist"></a> |
|
164 <h4>Eradicator.update_whitelist</h4> |
|
165 <b>update_whitelist</b>(<i>new_whitelist, extend_default=True</i>) |
|
166 |
|
167 <p> |
|
168 Updates the whitelist. |
|
169 </p> |
|
170 <div align="right"><a href="#top">Up</a></div> |
|
171 <hr /> |
|
172 <hr /> |
|
173 <a NAME="main" ID="main"></a> |
|
174 <h2>main</h2> |
|
175 <b>main</b>(<i>argv, standard_out, standard_error</i>) |
|
176 |
|
177 <p> |
|
178 Main entry point. |
|
179 </p> |
|
180 <div align="right"><a href="#top">Up</a></div> |
|
181 <hr /> |
|
182 </body></html> |