diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-08-24 11:47:32 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-08-24 11:47:32 +0100 |
commit | 72d41afb30d42e4c2d74e28abd3e2d6a3b54166f (patch) | |
tree | 27d396d540ca6bf8e52b0305012519db7d04e25b | |
parent | 8a462705c5a460595ea5ea7f255026e9611b34c2 (diff) | |
download | obnam-72d41afb30d42e4c2d74e28abd3e2d6a3b54166f.tar.gz |
Make "python setup.py clean" remove .pyc and _obnam.so.
-rw-r--r-- | setup.py | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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): |