/[ascend]/trunk/pygtk/ascend.in
ViewVC logotype

Diff of /trunk/pygtk/ascend.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 857 by johnpye, Fri Jul 14 03:35:16 2006 UTC revision 858 by johnpye, Mon Sep 25 15:04:48 2006 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!@PYTHON@
2    
3  if [ "x$ASCENDLIBRARY" != "x" ]; then  import os.path, sys;
     echo "USING ASCENDLIBRARY=$ASCENDLIBRARY"  
 else  
     ASCENDLIBRARY=@DEFAULT_ASCENDLIBRARY@  
 fi  
   
 args=$@  
   
 if [ "$OSTYPE" = "cygwin" ]; then  
     echo "CYGWIN..."  
 elif [ "$OSTYPE" = "msys" ]; then  
     #echo "MSYS..."  
     PYTHON=/c/Python24/python  
 fi  
   
 if [ $PYTHON ]; then  
     python=$PYTHON  
 else  
     python=`which python`  
 fi  
   
   
 if [ $ASC_GDB ]; then  
     echo "RUNNING THROUGH DEBUGGER"  
     ASC_DEBUGGER="gdb --symbols=../@ASC_SHLIBPREFIX@ascend@ASC_SHLIBSUFFIX@ --args"  
 fi  
   
 if [ "x$ASC_DEBUGGER" != "x" ]; then  
     bin="$ASC_DEBUGGER $python"  
 else  
     bin="$python"  
 fi  
   
 # if 'ascend' isn't in the path, assume ASC_DEV mode...  
 whichascend=`which ascend &2>/dev/null`  
 if [ $whichascend ]; then  
     echo $whichascend " ?"  
 else  
     ASC_DEV=1  
 fi  
   
 if [ "x$ASC_TEST" != "x" ]; then  
     # set the 'ASC_TEST' env var to run the suite of  
     # unit tests instead of running ASCEND GUI.  
     echo "LAUNCHING ASCEND TEST SUITE..."  
     export LD_LIBRARY_PATH=..  
     cmd="$bin test.py"  
 else  
     if [ "x$ASC_DEV" != "x" ]; then  
         # set the 'ASC_DEV' environment variable  
         # if you don't want to run ASCEND from the installed location  
         echo "NOTE! RUNNING ASC_DEV (LOCAL) MODE..."  
         export LD_LIBRARY_PATH=..  
         cmd="$bin gtkbrowser.py --pygtk-assets=glade/ --library=../models $args"  
         echo "Launching... $cmd"  
     else  
         cmd="$bin @INSTALL_ASCDATA@/gtkbrowser.py $args"  
     fi  
 fi  
   
 $cmd  
4    
5    if os.environ.get('ASCENDLIBRARY'):
6        ASCENDLIBRARY = os.environ.get('ASCENDLIBRARY')
7        print "USING ASCENDLIBRARY=%s" % ASCENDLIBRARY
8    else:
9        ASCENDLIBRARY = """@DEFAULT_ASCENDLIBRARY@"""
10    
11    
12    if os.environ.get('OSTYPE')=='cygwin':
13        print "CYGWIN..."
14    elif os.environ.get('OSTYPE')=='msys':
15        print "MSYS..."
16    
17    LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH')
18    if not LD_LIBRARY_PATH:
19        LD_LIBRARY_PATH = []
20    else:
21        LD_LIBRARY_PATH = LD_LIBRARY_PATH.split(":")
22    
23    if __name__=='__main__':
24        import ascpy
25        from gtkbrowser import *
26        if os.environ.get('ASC_DEV'):
27            d,f = os.path.split(os.path.abspath(sys.argv[0]))
28            if os.environ.get('ASC_START'):
29                os.chdir(os.environ.get('ASC_START'))
30            librarypath = ":".join(['.',os.path.normpath(os.path.join(d,"../models"))])
31            B = Browser(librarypath=librarypath,assetspath=os.path.join(d,"glade"))
32        else:
33            B = Browser()
34        B.run()

Legend:
Removed from v.857  
changed lines
  Added in v.858

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22