New submission from Leonid Vasilev <vsleo...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue12661>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to