summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-08-24 11:47:32 +0100
committerLars Wirzenius <liw@liw.fi>2011-08-24 11:47:32 +0100
commit72d41afb30d42e4c2d74e28abd3e2d6a3b54166f (patch)
tree27d396d540ca6bf8e52b0305012519db7d04e25b
parent8a462705c5a460595ea5ea7f255026e9611b34c2 (diff)
downloadobnam-72d41afb30d42e4c2d74e28abd3e2d6a3b54166f.tar.gz
Make "python setup.py clean" remove .pyc and _obnam.so.
-rw-r--r--setup.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index bdb05365..8b662661 100644
--- a/setup.py
+++ b/setup.py
@@ -40,10 +40,19 @@ class CleanMore(clean):
def run(self):
clean.run(self)
for x in ['blackboxtest.log', 'blackboxtest-obnam.log',
- 'obnam.1', 'obnam-benchmark.1']:
+ 'obnam.1', 'obnam-benchmark.1',
+ 'obnamlib/_obnam.so']:
if os.path.exists(x):
os.remove(x)
-
+ self.remove_pyc('obnamlib')
+ self.remove_pyc('test-plugins')
+
+ def remove_pyc(self, rootdir):
+ for dirname, subdirs, basenames in os.walk(rootdir):
+ for x in [os.path.join(dirname, base)
+ for base in basenames
+ if base.endswith('.pyc')]:
+ os.remove(x)
class Check(Command):