-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add ignore
argument to copytree
that lets one filter stuff out
#145
Comments
Is this issue still available? If that's the case I could work on this. Seems like applying the filter in this section should do the trick right? cloudpathlib/cloudpathlib/cloudpath.py Lines 778 to 786 in 203f6aa
Python does something similar I think, by iterating the paths and ignoring those that must be ignored. Relevant code:
About the callable that defines which objects to ignore, seems like Python's implementation is already good enough, maybe just use the same object (i.e., use the |
@aaossa Thanks for digging in here. First pass read of what you outlined seems right to me, thanks. Happy to take a PR with an implementation like that. Thanks! |
Sure, I'll be working on this in the upcoming days 👌 |
Created the PR with the proposed implementation in #272 . Every test is passed, including two tests added to confirm that the argument works as expected. |
Merged into the main branch, thanks! |
Could not find the |
shutil.copytree
has anignore
argument that lets one filter stuff out. Would be nice to support that too, but maybe it can be a future enhnacement.https://docs.python.org/3/library/shutil.html#shutil.copytree
Originally posted by @jayqi in #142 (comment)
Seems like
shutil
just supports callables, and we may even just be able to point users to the same pattern constructor: https://docs.python.org/3/library/shutil.html#shutil.ignore_patternsThe text was updated successfully, but these errors were encountered: