forked from emidln/M2Crypto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack.py
37 lines (28 loc) · 842 Bytes
/
pack.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
# Clean up M2Crypto source base.
import glob, os, os.path, sys
def zap(arg, dirname, names):
for f in glob.glob(dirname + arg):
try:
os.remove(f)
except:
pass
if __name__ == "__main__":
start = sys.argv[1]
os.path.walk(start, zap, "/*.pyc")
if os.name == 'nt':
zap_m2 = ("__m2cryptoc.pyd","_m2crypto.py")
elif os.name == 'posix':
zap_m2 = ("__m2crypto.so","_m2crypto.py")
for x in zap_m2:
try:
os.remove("%s/M2Crypto/%s" % (start, x))
except:
pass
zap_swig = ("_m2crypto_wrap*", "_m2crypto.c", "_m2crypto.py", "vc60.pdb")
for x in zap_swig:
for z in glob.glob("%s/SWIG/%s" % (start, x)):
try:
os.remove(z)
except:
pass