-
-
Notifications
You must be signed in to change notification settings - Fork 182
added max_depth #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added max_depth #102
Conversation
1 similar comment
| return "{}/{}".format(path1.rstrip('/'), path2.lstrip('/')) | ||
|
|
||
|
|
||
| def parts(path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@althonos any thoughts? |
|
Fine by me, kudos on the non-recursive implementation ! One remark though: the user may expect A workaround would be: class BaseWalker(object):
def _check_scan_dir(self, fs, path, info, depth):
return (self.max_depth is None or depth < self.max_depth) \
and self.check_scan_dir(fs, path, info, depth)
def check_scan_dir(self, fs, path, info, depth)
"""Override me !
"""
return TrueThat way, |
Work in progress.
Adds a max_depth parameter to fs.walk.