-
Notifications
You must be signed in to change notification settings - Fork 1
/
make_links_prom6.py
executable file
·46 lines (38 loc) · 1020 Bytes
/
make_links_prom6.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
36
37
38
39
40
41
42
43
44
#!/usr/bin/python
import os
import sys
import shutil
if len(sys.argv) < 2:
print "script.py <directory>"
exit(1)
destPath = sys.argv[1]
files = [f for f in os.listdir(destPath) if f != "ProM"]
i = 0
#libFile = os.path.abspath("/".join([os.curdir, destPath, "ProM", "lib"]))
libFile = "/".join(["..", "ProM", "lib"])
libProMFile = "/".join(["..", "ProM", "dist"])
for f in files:
try:
shutil.rmtree("/".join([destPath, f, "lib"]))
except:
pass
try:
os.unlink("/".join([destPath, f, "lib"]))
except:
pass
os.symlink(libFile, "/".join([destPath, f, "lib"]))
try:
shutil.rmtree("/".join([destPath, f, "packagelib"]))
except:
pass
try:
os.unlink("/".join([destPath, f, "packagelib"]))
except:
pass
os.symlink(libProMFile, "/".join([destPath, f, "packagelib"]))
try:
os.mkdir("/".join([destPath, f, "doc"]))
except:
pass
i+=1
print "Downloaded ", f, "%d/%d"%(i, len(files))