- Timestamp:
- 07/25/06 09:34:03 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/asap
r731 r1080 34 34 echo "Loading ASAP..." 35 35 36 prefix='/usr/local' 36 ip="`which ipython`" 37 p="`which python`" 37 38 38 # check if user set 39 if [ "x${ASAPDATA}" == "x" ]; then 40 ASAPDATA="${prefix}/share/asap" 41 export ASAPDATA 42 fi 43 44 if [ ! -d "${ASAPDATA}" ]; then 45 echo "Couldn't locate the asap data directory" 46 echo "Please set ASAPDATA" 47 #ASAPDATA="/nfs/aips++" 48 #export ASAPDATA 49 #exit 1 50 fi 51 52 # Keep casa measures happy 53 if test -d "${ASAPDATA}/data" ; then 54 platform='linux_gnu' 55 if [ `uname -s` == 'Darwin' ]; then 56 platform='darwin' 57 fi 58 AIPSPATH="${ASAPDATA} ${platform} somewhere localhost" 59 export AIPSPATH 60 else 61 echo "Couldn't find the ASAP data directory" 62 exit 1 63 fi 64 65 # started for the first time 66 ASAPUSERDIR="${HOME}/.asap"; export ASAPUSERDIR 67 if [ ! -d ${ASAPUSERDIR} ]; then 68 echo 'First time ASAP use. Setting up ~/.asap' 69 mkdir "${ASAPUSERDIR}" 70 cp "${ASAPDATA}/ipythonrc-asap" "${ASAPUSERDIR}/" 71 echo "#Dummy placeholder. All info is in ipythonrc-asap" > "${ASAPUSERDIR}/ipythonrc" 72 touch "${ASAPUSERDIR}/asapuserfuncs.py" 73 fi 74 75 ip="`which ipython`" 76 39 # no ipython installation - run without all the goodies 77 40 if [ ! -x "$ip" ]; then 78 41 echo "Can't find, or no execute permissions for 'ipython'" 79 42 echo "Running asap through 'python':" 80 p="`which python`"81 43 $p -c 'from asap import *' 82 44 else 83 $ip -ipythondir "${ASAPUSERDIR}" -p 'asap' $* 45 # if run for the first time set-up ipythonrc profile and ~/.asap 46 if [ ! -d "${HOME}/.asap" ]; then 47 $p -c "import asap" 48 fi 49 # now execute ipython using the profile 50 $ip -ipythondir "${HOME}/.asap" -p 'asap' $* 84 51 fi
Note:
See TracChangeset
for help on using the changeset viewer.