Author ncoghlan
Recipients ncoghlan
Date 2011-10-20.02:05:29
SpamBayes Score 3.03493e-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:30ncoghlansetrecipients: + ncoghlan
2011-10-20 02:05:30ncoghlansetmessageid: <1319076330.7.0.757546324527.issue13229@psf.upfronthosting.co.za>
2011-10-20 02:05:30ncoghlanlinkissue13229 messages
2011-10-20 02:05:29ncoghlancreate