2003-03-12 07:26:59 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2003-08-19 12:38:45 +02:00
|
|
|
import os, os.path
|
2003-03-12 07:26:59 +01:00
|
|
|
|
2003-08-19 12:38:45 +02:00
|
|
|
def removeFiles(_, dirname, names):
|
2003-03-12 07:26:59 +01:00
|
|
|
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'):
|
2003-04-02 10:00:57 +02:00
|
|
|
filename = os.path.join('logs', name)
|
|
|
|
if os.path.isfile(filename):
|
|
|
|
os.remove(filename)
|
2003-03-12 07:26:59 +01:00
|
|
|
os.path.walk(os.curdir, removeFiles, None)
|
2003-04-01 12:06:42 +02:00
|
|
|
|
2003-03-24 09:41:19 +01:00
|
|
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|