[issue12661] [new function] shutil.cleartree

Leonid Vasilev report at bugs.python.org
Sat Jul 30 19:52:52 CEST 2011


New submission from Leonid Vasilev <vsleonid at gmail.com>:

Hello,

This patch adds new function to shutil.
I think it's quite generic, and it fits shutil purpose.

Sample usage:
shutil.cleartree(path='/home/chin/Dev/python-hg-dev', ignore=shutil.ignore_pattterns('*.py'))

removes all files from path, except *.py files. 

and

shutil.cleartree(path='/home/chin/Dev/python-hg-dev', ignore=shutil.ignore_pattterns('*.pyc'), invert=True)

is equivalent to `find /home/chin/Dev/python-hg-dev -name "*.pyc" -delete`

----------
components: Library (Lib)
files: shutil.cleartree.patch
keywords: patch
messages: 141450
nosy: chin
priority: normal
severity: normal
status: open
title: [new function] shutil.cleartree
type: feature request
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file22804/shutil.cleartree.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12661>
_______________________________________


More information about the Python-bugs-list mailing list