/
install.py
executable file
·81 lines (59 loc) · 2.54 KB
/
install.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import sys, os, shutil
#li = sys.argv.index ( "install.py" )
#print li
if len(sys.argv) != 2 :
print ""
print "Please add the path where Chimera is installed, e.g.:"
print " python install.py /home/greg/applications/Chimera"
print ""
exit()
print ""
opath1 = os.path.join ( sys.argv[1], "Contents" )
opath1 = os.path.join ( opath1, "Resources" )
opath1 = os.path.join ( opath1, "share" )
opath2 = os.path.join ( sys.argv[1], "share" )
didInstall = False
for opath in [opath1, opath2] :
if os.path.isdir( opath ) :
opath = os.path.join ( opath, "modelz" )
if os.path.isdir( opath ) :
print " - removing previous ModelZ:", opath
try :
shutil.rmtree(opath)
except :
pass
#print " - copying from:", os.getcwd()
print " - copying . ->", opath
try :
shutil.copytree ( os.getcwd(), opath )
didInstall = True
except :
print "Could not copy to:", opath
print " 1. please check if you have write access"
print " 2. try with sudo python install.py <path to Chimera>"
print ""
break
didInstall = True
if didInstall :
print ""
print "Installation complete."
print ""
print "To use:"
print " 1. Please restart Chimera."
print " 2. Select Tools -> Volume Data -> ModelZ"
print ' 3. Please note that on Mac OS, you may see the message "Chimera is damaged and cannot be opened." Please see the following link for the solution: https://www.santoshsrinivas.com/disable-gatekeeper-in-macos-sierra/'
print ' 4. More info: https://cryoem.slac.stanford.edu/ncmi/resources/software/modelz'
print ' 5. Tutorial: https://github.com/gregdp/modelz/blob/master/tutorials/Tutorial-ModelZ.pdf'
print " 6. Let us know about yourself and if we can contact you for updates and other related information: https://cryoem.slac.stanford.edu/ncmi/content/modelz-registration"
print ' 7. For other questions/comments/suggestions, please contact gregp@slac.stanford.edu'
print ""
#wh = os.path.join ( os.getcwd(), "install.html" )
#import webbrowser
#webbrowser.open( 'file://' + wh, new=2)
else :
print ""
print 'Chimera not found in "' + sys.argv[1] + '"'
print " 1. please check the path"
print " 2. remember you can auto-complete while typing the path with <tab>"
print " 3. if issue persists, please report to gregp@slac.stanford.edu"
print ""