Limnoria/scripts/clean.py
2003-08-19 10:38:45 +00:00

20 lines
559 B
Python
Executable File

#!/usr/bin/env python
import os, os.path
def removeFiles(_, dirname, names):
for name in names:
if name[-4:] in ('.pyc', 'pyo'):
os.remove(os.path.join(dirname, name))
elif name[-1] == '~':
os.remove(os.path.join(dirname, name))
if __name__ == '__main__':
for name in os.listdir('logs'):
filename = os.path.join('logs', name)
if os.path.isfile(filename):
os.remove(filename)
os.path.walk(os.curdir, removeFiles, None)
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: