Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python distutils - copy_tree with filter

I want to copy a data directory into my distribution dir. copy_tree does this just fine. However, the project is also an svn repository, and I don't want the distribution to have all the .svn files that the data dir has. Is there any easy way to do a copy_tree excluding the .svn files, or should I just write my own recursive dir copy? I feel someone must have had this issue before.

like image 444
Claudiu Avatar asked May 28 '26 15:05

Claudiu


1 Answers

I just used shutil.copytree, which takes an ignore kwd arg.

like image 55
Claudiu Avatar answered May 30 '26 05:05

Claudiu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!