~sschwarzer/ftputil#4: 
Add FTPHost.walk

Python 2.3 introduced an ​os.walk function which is much more pythonic than the still existing ​os.path.walk function.

I'm not sure whether the code of the new function should also be compatible with Python 2.0, like the rest of ftputil 2.0.3. When using generators/iterators (which where ​introduced in Python 2.2), the implementation would be much easier.

Status
RESOLVED FIXED
Submitter
schwa (unverified)
Assigned to
No-one
Submitted
18 years ago
Updated
11 days ago
Labels
enhancement library

schwa (unverified) 18 years ago · edit

I've added the 'walk' method to FTPHost. It was an easy implementation because I could use the code from Python's os.walk with only small changes. On the other hand, this means that FTPHost.walk will only work with Python versions 2.2 and above. Earlier versions don't support the necessary generators.

Register here or Log in to comment, or comment via email.