Files
pytest2/py/cmdline/pycleanup.py
hpk a999dc8472 [svn r57540] merge changes from release branch back
[svn merge -r 57430:HEAD ../release/0.9.x/ .]

* cmdline script organisation
* execnet windows fixes
* documentation updates
* test skips

also regen setup.py

--HG--
branch : trunk
2008-08-21 12:18:58 +02:00

22 lines
570 B
Python
Executable File

#!/usr/bin/env python
"""\
py.cleanup [PATH]
Delete pyc file recursively, starting from PATH (which defaults to the current
working directory). Don't follow links and don't recurse into directories with
a ".".
"""
import py
def main():
parser = py.compat.optparse.OptionParser(usage=__doc__)
(options, args) = parser.parse_args()
if not args:
args = ["."]
for arg in args:
path = py.path.local(arg)
print "cleaning path", path
for x in path.visit('*.pyc', lambda x: x.check(dotfile=0, link=0)):
x.remove()