Changeset 343 for SH_SHM/trunk/setup/setup.py
- Timestamp:
- 03/10/2011 01:47:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SH_SHM/trunk/setup/setup.py
r340 r343 33 33 34 34 def banner(): 35 print "="*7 835 print "="*70 36 36 print " Setup program v0.1 for Seismic Handler (SH/SHM)" 37 print "="*7 837 print "="*70 38 38 print "\n This piece of software will try to setup the included source code.\n" 39 39 40 def download(target, pkg ):40 def download(target, pkg, dbg): 41 41 print "Downloading %s..." % pkg 42 os.system("wget -q -P %s %s" % (target, downloads[pkg])) 42 43 verbose = dbg and "" or "-q " 44 45 if os.system("wget %s-P %s %s" % (verbose, target, downloads[pkg])): 46 abort("Cannot download %s. Exit here." % pkg) 43 47 44 48 def setup(**kwargs): … … 83 87 84 88 copy(os.path.join(data["pwd"], ".."), os.path.join(target, "sh"), dbg) 85 download(target, "locsat" )86 download(target, "fk" )89 download(target, "locsat", dbg) 90 download(target, "fk", dbg) 87 91 88 install(target) 89 customize(target) 92 exitcode = install(target, dbg) 93 if exitcode == 99: 94 abort("Installation aborted.") 95 elif exitcode: 96 abort("Installation errors occured. Please check output.") 90 97 91 def customize(target): 98 customize(target, dbg) 99 100 def customize(target, dbg): 92 101 """ 93 102 Offers usage of new configuration files. … … 97 106 98 107 flist = ["STATINF.DAT", "sensitivities.txt", "filter_lookup.txt"] 99 100 print "\nA backup of your shm-config.txt has been saved under"101 print " %s/sh/inputs/shm-config.txt.yours" % target102 108 103 109 print "\nSeismic Handler comes with updated station configuration files." … … 117 123 os.system("cp %s %s" % (tname+".dist", tname)) 118 124 119 def install(target): 120 os.system(os.path.join(target, "sh/setup/SHM-install.csh %s" % target)) 125 def install(target, dbg): 126 exitcode = \ 127 os.system(os.path.join(target, "sh/setup/SHM-install.csh %s" % target)) 128 129 return exitcode >> 8 121 130 122 131 def copy(src, trt, dbg=False):
Note: See TracChangeset
for help on using the changeset viewer.