source: TI03-DataExtractor/branches/old_stuff/dx_source/setup.py @ 793

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/branches/old_stuff/dx_source/setup.py@793
Revision 793, 2.1 KB checked in by astephen, 13 years ago (diff)

Put all the old code in the old_stuff branch.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2
3"""
4setup.py
5========
6
7Basic (and non-pythonic) set-up script for installing the various parts
8of dx into the appropriate directories.
9
10The directories in the for_usr_local/dx/config.py file are used to
11put the files in place for you.
12
13"""
14
15# Import standard library modules
16import os
17import sys
18
19# Import package modules
20sys.path.insert(0, 'for_usr_local/dx')
21from config import *
22
23print "Installing the main package (dx)..."
24print "To directory:", BASEDIR
25os.system('cp -fr for_usr_local/dx %s' % BASEDIR)
26
27print "Replacing some configuration needed in the CGI script..."
28os.system("cp dxui.unchanged for_cgi_bin/dxui.py")
29full_cdat_bin_path=os.path.join(CDAT_BIN_PATH, "python")
30os.system("perl -p -i -w -e 's!INSERT_FULL_CDAT_PYTHON_BIN_PATH_HERE!%s!g;' for_cgi_bin/dxui.py" % full_cdat_bin_path)
31package_module=os.path.split(BASEDIR)[-1]
32os.system("perl -p -i -w -e 's!INSERT_BASEDIR_HERE!%s!g;' for_cgi_bin/dxui.py" % BASEDIR)
33os.system("perl -p -i -w -e 's!INSERT_PACKAGE_MODULE_HERE!%s!g;' for_cgi_bin/dxui.py" % package_module)
34
35print "Installing the CGI script (normally called 'dxui.py')..."
36print "To directory:", CGI_DIR
37if not os.path.isdir(CGI_DIR): 
38        os.mkdir(CGI_DIR)
39cgi_script=os.path.split(CGI_NAME)[-1]
40os.system('cp -fr for_cgi_bin/dxui.py %s/%s' % (CGI_DIR,cgi_script))
41
42print "Installing the additional static web files..."
43print "To directory:", LOCAL_EXTRAS_DIR
44os.system('cp -fr for_static_web/dx_extra %s' % LOCAL_EXTRAS_DIR)
45
46print "Create directory for user output files..."
47print "Creating:", OUTPUT_DIR
48if not os.path.isdir(OUTPUT_DIR):
49    os.mkdir(OUTPUT_DIR)
50else:
51    print "Output directory '%s' exists already." % OUTPUT_DIR
52
53print "Changing permissions to read/write/execute for output directory..."
54os.chmod(OUTPUT_DIR, 0777)
55print "...and request xml directory..."
56os.chmod(REQUEST_XML_DIR, 0777)
57
58depracatedMessage="""
59
60=====================
61Setup was successful!
62=====================
63
64You now need to make sure that you enabled other hosts to plot
65on the local machine. To do this type:
66
67xhost +
68
69Note that you will have to do this everytime you restart the machine.
70"""
Note: See TracBrowser for help on using the repository browser.