|
1 <?xml version="1.0" encoding="ascii"?> |
|
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|
3 "DTD/xhtml1-transitional.dtd"> |
|
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
5 <head> |
|
6 <title>fileutils.AbstractScanner</title> |
|
7 <link rel="stylesheet" href="epydoc.css" type="text/css" /> |
|
8 <script type="text/javascript" src="epydoc.js"></script> |
|
9 </head> |
|
10 |
|
11 <body bgcolor="white" text="black" link="blue" vlink="#204080" |
|
12 alink="#204080"> |
|
13 <!-- ==================== NAVIGATION BAR ==================== --> |
|
14 <table class="navbar" border="0" width="100%" cellpadding="0" |
|
15 bgcolor="#a0c0ff" cellspacing="0"> |
|
16 <tr valign="middle"> |
|
17 |
|
18 <!-- Tree link --> |
|
19 <th> <a |
|
20 href="module-tree.html">Trees</a> </th> |
|
21 |
|
22 <!-- Index link --> |
|
23 <th> <a |
|
24 href="identifier-index.html">Indices</a> </th> |
|
25 |
|
26 <!-- Help link --> |
|
27 <th> <a |
|
28 href="help.html">Help</a> </th> |
|
29 |
|
30 <th class="navbar" width="100%"></th> |
|
31 </tr> |
|
32 </table> |
|
33 <table width="100%" cellpadding="0" cellspacing="0"> |
|
34 <tr valign="top"> |
|
35 <td width="100%"> |
|
36 <span class="breadcrumbs"> |
|
37 <a href="fileutils-module.html">Module fileutils</a> :: |
|
38 Class AbstractScanner |
|
39 </span> |
|
40 </td> |
|
41 <td> |
|
42 <table cellpadding="0" cellspacing="0"> |
|
43 <!-- hide/show private --> |
|
44 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" |
|
45 onclick="toggle_private();">hide private</a>]</span></td></tr> |
|
46 <tr><td align="right"><span class="options" |
|
47 >[<a href="frames.html" target="_top">frames</a |
|
48 >] | <a href="fileutils.AbstractScanner-class.html" |
|
49 target="_top">no frames</a>]</span></td></tr> |
|
50 </table> |
|
51 </td> |
|
52 </tr> |
|
53 </table> |
|
54 <!-- ==================== CLASS DESCRIPTION ==================== --> |
|
55 <h1 class="epydoc">Class AbstractScanner</h1><span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner">source code</a></span><br /><br /> |
|
56 <pre class="base-tree"> |
|
57 object --+ |
|
58 | |
|
59 <strong class="uidshort">AbstractScanner</strong> |
|
60 </pre> |
|
61 |
|
62 <hr /> |
|
63 This class implements all the required infrastructure for filescanning.<br /><br /> |
|
64 |
|
65 <!-- ==================== INSTANCE METHODS ==================== --> |
|
66 <a name="section-InstanceMethods"></a> |
|
67 <table class="summary" border="1" cellpadding="3" |
|
68 cellspacing="0" width="100%" bgcolor="white"> |
|
69 <tr bgcolor="#70b0f0" class="table-header"> |
|
70 <td colspan="2" class="table-header"> |
|
71 <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
|
72 <tr valign="top"> |
|
73 <td align="left"><span class="table-header">Instance Methods</span></td> |
|
74 <td align="right" valign="top" |
|
75 ><span class="options">[<a href="#section-InstanceMethods" |
|
76 class="privatelink" onclick="toggle_private();" |
|
77 >hide private</a>]</span></td> |
|
78 </tr> |
|
79 </table> |
|
80 </td> |
|
81 </tr> |
|
82 <tr> |
|
83 <td width="15%" align="right" valign="top" class="summary"> |
|
84 <span class="summary-type"> </span> |
|
85 </td><td class="summary"> |
|
86 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
87 <tr> |
|
88 <td><span class="summary-sig"><a href="fileutils.AbstractScanner-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
89 Initialization.</td> |
|
90 <td align="right" valign="top"> |
|
91 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.__init__">source code</a></span> |
|
92 |
|
93 </td> |
|
94 </tr> |
|
95 </table> |
|
96 |
|
97 </td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td width="15%" align="right" valign="top" class="summary"> |
|
101 <span class="summary-type"> </span> |
|
102 </td><td class="summary"> |
|
103 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
104 <tr> |
|
105 <td><span class="summary-sig"><a name="add_include"></a><span class="summary-sig-name">add_include</span>(<span class="summary-sig-arg">self</span>, |
|
106 <span class="summary-sig-arg">include</span>)</span><br /> |
|
107 Adds an include path to the scanner.</td> |
|
108 <td align="right" valign="top"> |
|
109 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.add_include">source code</a></span> |
|
110 |
|
111 </td> |
|
112 </tr> |
|
113 </table> |
|
114 |
|
115 </td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td width="15%" align="right" valign="top" class="summary"> |
|
119 <span class="summary-type"> </span> |
|
120 </td><td class="summary"> |
|
121 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
122 <tr> |
|
123 <td><span class="summary-sig"><a name="add_exclude"></a><span class="summary-sig-name">add_exclude</span>(<span class="summary-sig-arg">self</span>, |
|
124 <span class="summary-sig-arg">exclude</span>)</span><br /> |
|
125 Adds an exclude path to the scanner.</td> |
|
126 <td align="right" valign="top"> |
|
127 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.add_exclude">source code</a></span> |
|
128 |
|
129 </td> |
|
130 </tr> |
|
131 </table> |
|
132 |
|
133 </td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td width="15%" align="right" valign="top" class="summary"> |
|
137 <span class="summary-type"> </span> |
|
138 </td><td class="summary"> |
|
139 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
140 <tr> |
|
141 <td><span class="summary-sig"><a name="add_exclude_file"></a><span class="summary-sig-name">add_exclude_file</span>(<span class="summary-sig-arg">self</span>, |
|
142 <span class="summary-sig-arg">exclude</span>)</span><br /> |
|
143 Adds an exclude file to the scanner.</td> |
|
144 <td align="right" valign="top"> |
|
145 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.add_exclude_file">source code</a></span> |
|
146 |
|
147 </td> |
|
148 </tr> |
|
149 </table> |
|
150 |
|
151 </td> |
|
152 </tr> |
|
153 <tr> |
|
154 <td width="15%" align="right" valign="top" class="summary"> |
|
155 <span class="summary-type"> </span> |
|
156 </td><td class="summary"> |
|
157 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
158 <tr> |
|
159 <td><span class="summary-sig"><a name="add_selector"></a><span class="summary-sig-name">add_selector</span>(<span class="summary-sig-arg">self</span>, |
|
160 <span class="summary-sig-arg">selector</span>)</span><br /> |
|
161 Add selector to the scanner.</td> |
|
162 <td align="right" valign="top"> |
|
163 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.add_selector">source code</a></span> |
|
164 |
|
165 </td> |
|
166 </tr> |
|
167 </table> |
|
168 |
|
169 </td> |
|
170 </tr> |
|
171 <tr> |
|
172 <td width="15%" align="right" valign="top" class="summary"> |
|
173 <span class="summary-type"> </span> |
|
174 </td><td class="summary"> |
|
175 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
176 <tr> |
|
177 <td><span class="summary-sig"><a name="add_filetype"></a><span class="summary-sig-name">add_filetype</span>(<span class="summary-sig-arg">self</span>, |
|
178 <span class="summary-sig-arg">filetype</span>)</span><br /> |
|
179 Adds a filetype selection to the scanner.</td> |
|
180 <td align="right" valign="top"> |
|
181 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.add_filetype">source code</a></span> |
|
182 |
|
183 </td> |
|
184 </tr> |
|
185 </table> |
|
186 |
|
187 </td> |
|
188 </tr> |
|
189 <tr> |
|
190 <td width="15%" align="right" valign="top" class="summary"> |
|
191 <span class="summary-type"> </span> |
|
192 </td><td class="summary"> |
|
193 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
194 <tr> |
|
195 <td><span class="summary-sig"><a name="is_included"></a><span class="summary-sig-name">is_included</span>(<span class="summary-sig-arg">self</span>, |
|
196 <span class="summary-sig-arg">path</span>)</span><br /> |
|
197 Returns if path is included by the scanner.</td> |
|
198 <td align="right" valign="top"> |
|
199 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.is_included">source code</a></span> |
|
200 |
|
201 </td> |
|
202 </tr> |
|
203 </table> |
|
204 |
|
205 </td> |
|
206 </tr> |
|
207 <tr> |
|
208 <td width="15%" align="right" valign="top" class="summary"> |
|
209 <span class="summary-type"> </span> |
|
210 </td><td class="summary"> |
|
211 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
212 <tr> |
|
213 <td><span class="summary-sig"><a name="is_excluded"></a><span class="summary-sig-name">is_excluded</span>(<span class="summary-sig-arg">self</span>, |
|
214 <span class="summary-sig-arg">path</span>)</span><br /> |
|
215 Returns if path is excluded by the scanner.</td> |
|
216 <td align="right" valign="top"> |
|
217 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.is_excluded">source code</a></span> |
|
218 |
|
219 </td> |
|
220 </tr> |
|
221 </table> |
|
222 |
|
223 </td> |
|
224 </tr> |
|
225 <tr> |
|
226 <td width="15%" align="right" valign="top" class="summary"> |
|
227 <span class="summary-type"> </span> |
|
228 </td><td class="summary"> |
|
229 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
230 <tr> |
|
231 <td><span class="summary-sig"><a name="is_selected"></a><span class="summary-sig-name">is_selected</span>(<span class="summary-sig-arg">self</span>, |
|
232 <span class="summary-sig-arg">path</span>)</span><br /> |
|
233 Returns if path is selected by all selectors in the scanner.</td> |
|
234 <td align="right" valign="top"> |
|
235 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.is_selected">source code</a></span> |
|
236 |
|
237 </td> |
|
238 </tr> |
|
239 </table> |
|
240 |
|
241 </td> |
|
242 </tr> |
|
243 <tr> |
|
244 <td width="15%" align="right" valign="top" class="summary"> |
|
245 <span class="summary-type"> </span> |
|
246 </td><td class="summary"> |
|
247 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
248 <tr> |
|
249 <td><span class="summary-sig"><a name="is_filetype"></a><span class="summary-sig-name">is_filetype</span>(<span class="summary-sig-arg">self</span>, |
|
250 <span class="summary-sig-arg">path</span>)</span><br /> |
|
251 Test if a file matches one filetype.</td> |
|
252 <td align="right" valign="top"> |
|
253 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.is_filetype">source code</a></span> |
|
254 |
|
255 </td> |
|
256 </tr> |
|
257 </table> |
|
258 |
|
259 </td> |
|
260 </tr> |
|
261 <tr> |
|
262 <td width="15%" align="right" valign="top" class="summary"> |
|
263 <span class="summary-type"> </span> |
|
264 </td><td class="summary"> |
|
265 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
266 <tr> |
|
267 <td><span class="summary-sig"><a name="match"></a><span class="summary-sig-name">match</span>(<span class="summary-sig-arg">self</span>, |
|
268 <span class="summary-sig-arg">filename</span>, |
|
269 <span class="summary-sig-arg">pattern</span>)</span><br /> |
|
270 Is filename matching pattern?</td> |
|
271 <td align="right" valign="top"> |
|
272 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.match">source code</a></span> |
|
273 |
|
274 </td> |
|
275 </tr> |
|
276 </table> |
|
277 |
|
278 </td> |
|
279 </tr> |
|
280 <tr> |
|
281 <td width="15%" align="right" valign="top" class="summary"> |
|
282 <span class="summary-type"> </span> |
|
283 </td><td class="summary"> |
|
284 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
285 <tr> |
|
286 <td><span class="summary-sig"><a name="test_path"></a><span class="summary-sig-name">test_path</span>(<span class="summary-sig-arg">self</span>, |
|
287 <span class="summary-sig-arg">root</span>, |
|
288 <span class="summary-sig-arg">relpath</span>)</span><br /> |
|
289 Test if a path matches filetype, include, exclude, and selection process.</td> |
|
290 <td align="right" valign="top"> |
|
291 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.test_path">source code</a></span> |
|
292 |
|
293 </td> |
|
294 </tr> |
|
295 </table> |
|
296 |
|
297 </td> |
|
298 </tr> |
|
299 <tr> |
|
300 <td width="15%" align="right" valign="top" class="summary"> |
|
301 <span class="summary-type"> </span> |
|
302 </td><td class="summary"> |
|
303 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
304 <tr> |
|
305 <td><span class="summary-sig"><a href="fileutils.AbstractScanner-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
306 Returns a string representing this instance.</td> |
|
307 <td align="right" valign="top"> |
|
308 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.__str__">source code</a></span> |
|
309 |
|
310 </td> |
|
311 </tr> |
|
312 </table> |
|
313 |
|
314 </td> |
|
315 </tr> |
|
316 <tr> |
|
317 <td width="15%" align="right" valign="top" class="summary"> |
|
318 <span class="summary-type"> </span> |
|
319 </td><td class="summary"> |
|
320 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
321 <tr> |
|
322 <td><span class="summary-sig"><a href="fileutils.AbstractScanner-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
323 Returns a string representing this instance.</td> |
|
324 <td align="right" valign="top"> |
|
325 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.__repr__">source code</a></span> |
|
326 |
|
327 </td> |
|
328 </tr> |
|
329 </table> |
|
330 |
|
331 </td> |
|
332 </tr> |
|
333 <tr> |
|
334 <td width="15%" align="right" valign="top" class="summary"> |
|
335 <span class="summary-type"> </span> |
|
336 </td><td class="summary"> |
|
337 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
338 <tr> |
|
339 <td><span class="summary-sig"><a name="scan"></a><span class="summary-sig-name">scan</span>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
340 Abstract method which much be overriden to implement the scanning process.</td> |
|
341 <td align="right" valign="top"> |
|
342 <span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.scan">source code</a></span> |
|
343 |
|
344 </td> |
|
345 </tr> |
|
346 </table> |
|
347 |
|
348 </td> |
|
349 </tr> |
|
350 <tr> |
|
351 <td colspan="2" class="summary"> |
|
352 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
|
353 <code>__delattr__</code>, |
|
354 <code>__getattribute__</code>, |
|
355 <code>__hash__</code>, |
|
356 <code>__new__</code>, |
|
357 <code>__reduce__</code>, |
|
358 <code>__reduce_ex__</code>, |
|
359 <code>__setattr__</code> |
|
360 </p> |
|
361 </td> |
|
362 </tr> |
|
363 </table> |
|
364 <!-- ==================== PROPERTIES ==================== --> |
|
365 <a name="section-Properties"></a> |
|
366 <table class="summary" border="1" cellpadding="3" |
|
367 cellspacing="0" width="100%" bgcolor="white"> |
|
368 <tr bgcolor="#70b0f0" class="table-header"> |
|
369 <td colspan="2" class="table-header"> |
|
370 <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
|
371 <tr valign="top"> |
|
372 <td align="left"><span class="table-header">Properties</span></td> |
|
373 <td align="right" valign="top" |
|
374 ><span class="options">[<a href="#section-Properties" |
|
375 class="privatelink" onclick="toggle_private();" |
|
376 >hide private</a>]</span></td> |
|
377 </tr> |
|
378 </table> |
|
379 </td> |
|
380 </tr> |
|
381 <tr> |
|
382 <td colspan="2" class="summary"> |
|
383 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
|
384 <code>__class__</code> |
|
385 </p> |
|
386 </td> |
|
387 </tr> |
|
388 </table> |
|
389 <!-- ==================== METHOD DETAILS ==================== --> |
|
390 <a name="section-MethodDetails"></a> |
|
391 <table class="details" border="1" cellpadding="3" |
|
392 cellspacing="0" width="100%" bgcolor="white"> |
|
393 <tr bgcolor="#70b0f0" class="table-header"> |
|
394 <td colspan="2" class="table-header"> |
|
395 <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
|
396 <tr valign="top"> |
|
397 <td align="left"><span class="table-header">Method Details</span></td> |
|
398 <td align="right" valign="top" |
|
399 ><span class="options">[<a href="#section-MethodDetails" |
|
400 class="privatelink" onclick="toggle_private();" |
|
401 >hide private</a>]</span></td> |
|
402 </tr> |
|
403 </table> |
|
404 </td> |
|
405 </tr> |
|
406 </table> |
|
407 <a name="__init__"></a> |
|
408 <div> |
|
409 <table class="details" border="1" cellpadding="3" |
|
410 cellspacing="0" width="100%" bgcolor="white"> |
|
411 <tr><td> |
|
412 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
413 <tr valign="top"><td> |
|
414 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>)</span> |
|
415 <br /><em class="fname">(Constructor)</em> |
|
416 </h3> |
|
417 </td><td align="right" valign="top" |
|
418 ><span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.__init__">source code</a></span> |
|
419 </td> |
|
420 </table> |
|
421 |
|
422 Initialization. |
|
423 <dl class="fields"> |
|
424 <dt>Overrides: |
|
425 object.__init__ |
|
426 </dt> |
|
427 </dl> |
|
428 </td></tr></table> |
|
429 </div> |
|
430 <a name="__str__"></a> |
|
431 <div> |
|
432 <table class="details" border="1" cellpadding="3" |
|
433 cellspacing="0" width="100%" bgcolor="white"> |
|
434 <tr><td> |
|
435 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
436 <tr valign="top"><td> |
|
437 <h3 class="epydoc"><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span> |
|
438 <br /><em class="fname">(Informal representation operator)</em> |
|
439 </h3> |
|
440 </td><td align="right" valign="top" |
|
441 ><span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.__str__">source code</a></span> |
|
442 </td> |
|
443 </table> |
|
444 |
|
445 Returns a string representing this instance. |
|
446 <dl class="fields"> |
|
447 <dt>Overrides: |
|
448 object.__str__ |
|
449 </dt> |
|
450 </dl> |
|
451 </td></tr></table> |
|
452 </div> |
|
453 <a name="__repr__"></a> |
|
454 <div> |
|
455 <table class="details" border="1" cellpadding="3" |
|
456 cellspacing="0" width="100%" bgcolor="white"> |
|
457 <tr><td> |
|
458 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
459 <tr valign="top"><td> |
|
460 <h3 class="epydoc"><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">self</span>)</span> |
|
461 <br /><em class="fname">(Representation operator)</em> |
|
462 </h3> |
|
463 </td><td align="right" valign="top" |
|
464 ><span class="codelink"><a href="fileutils-pysrc.html#AbstractScanner.__repr__">source code</a></span> |
|
465 </td> |
|
466 </table> |
|
467 |
|
468 Returns a string representing this instance. |
|
469 <dl class="fields"> |
|
470 <dt>Overrides: |
|
471 object.__repr__ |
|
472 </dt> |
|
473 </dl> |
|
474 </td></tr></table> |
|
475 </div> |
|
476 <br /> |
|
477 <!-- ==================== NAVIGATION BAR ==================== --> |
|
478 <table class="navbar" border="0" width="100%" cellpadding="0" |
|
479 bgcolor="#a0c0ff" cellspacing="0"> |
|
480 <tr valign="middle"> |
|
481 |
|
482 <!-- Tree link --> |
|
483 <th> <a |
|
484 href="module-tree.html">Trees</a> </th> |
|
485 |
|
486 <!-- Index link --> |
|
487 <th> <a |
|
488 href="identifier-index.html">Indices</a> </th> |
|
489 |
|
490 <!-- Help link --> |
|
491 <th> <a |
|
492 href="help.html">Help</a> </th> |
|
493 |
|
494 <th class="navbar" width="100%"></th> |
|
495 </tr> |
|
496 </table> |
|
497 <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
|
498 <tr> |
|
499 <td align="left" class="footer"> |
|
500 Generated by Epydoc 3.0beta1 on Wed Sep 09 13:44:18 2009 |
|
501 </td> |
|
502 <td align="right" class="footer"> |
|
503 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a> |
|
504 </td> |
|
505 </tr> |
|
506 </table> |
|
507 |
|
508 <script type="text/javascript"> |
|
509 <!-- |
|
510 // Private objects are initially displayed (because if |
|
511 // javascript is turned off then we want them to be |
|
512 // visible); but by default, we want to hide them. So hide |
|
513 // them unless we have a cookie that says to show them. |
|
514 checkCookie() |
|
515 // --> |
|
516 </script> |
|
517 |
|
518 </body> |
|
519 </html> |