Message145999
| Author |
ncoghlan |
| Recipients |
ncoghlan |
| Date |
2011年10月20日.02:05:29 |
| SpamBayes Score |
3.0349294e-05 |
| Marked as misclassified |
No |
| Message-id |
<1319076330.7.0.757546324527.issue13229@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I needed a depth-limited, filtered search of a directory tree recently and came up with the following wrapper around os.walk that brings in a few niceties like glob-style filtering, depth limiting and symlink traversal that is safe from infinite loops. It also emits a named tuple rather than the bare tuple emitted by os.walk:
http://code.activestate.com/recipes/577913-selective-directory-walking/
I think this would make a nice addition to 3.3 as shutil.filter_walk, but it need tests, documentation and reformatting as a patch before it can go anywhere. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年10月20日 02:05:30 | ncoghlan | set | recipients:
+ ncoghlan |
| 2011年10月20日 02:05:30 | ncoghlan | set | messageid: <1319076330.7.0.757546324527.issue13229@psf.upfronthosting.co.za> |
| 2011年10月20日 02:05:30 | ncoghlan | link | issue13229 messages |
| 2011年10月20日 02:05:29 | ncoghlan | create |
|