/[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 1614 by jpye, Mon Sep 3 06:54:37 2007 UTC revision 1615 by jpye, Mon Sep 3 12:40:36 2007 UTC
# Line 1  Line 1 
1  #!@PYTHON@  #!@PYTHON@
2  # ^ python path substituted here is not depended upon in Windows  # ^ python path substituted here is not depended-upon in Windows
3    
4  import os.path, sys, platform  import os.path, sys, platform
5    
# Line 65  if not os.environ.get('ASC_GDB'): Line 65  if not os.environ.get('ASC_GDB'):
65          LDPATH=[INSTALL_LIB,GTKLIBS]+LDPATH          LDPATH=[INSTALL_LIB,GTKLIBS]+LDPATH
66          os.environ[LDPATHVAR] = SEP.join(LDPATH)          os.environ[LDPATHVAR] = SEP.join(LDPATH)
67          restart = 1          restart = 1
   
68      elif INSTALL_LIB != "/usr/lib" and not INSTALL_LIB in LDPATH:      elif INSTALL_LIB != "/usr/lib" and not INSTALL_LIB in LDPATH:
69          # don't worry about GTK location; just ensure that LDPATH includes INSTALL_LIB          # don't worry about GTK location; just ensure that LDPATH includes INSTALL_LIB
70          LDPATH = [INSTALL_LIB] + LDPATH          LDPATH = [INSTALL_LIB] + LDPATH
71          os.environ[LDPATHVAR] = SEP.join(LDPATH)          os.environ[LDPATHVAR] = SEP.join(LDPATH)
72          restart = 1          restart = 1
73    
74        # if ASCENDLIBRARY has been specified, make sure it's including the Model Library
75      if os.environ.get('ASCENDLIBRARY'):      if os.environ.get('ASCENDLIBRARY'):
76          envmodels = [os.path.abspath(i) for i in os.environ['ASCENDLIBRARY'].split(SEP)]          envmodels = [os.path.abspath(i) for i in os.environ['ASCENDLIBRARY'].split(SEP)]
77          if not INSTALL_MODELS in envmodels:          if not INSTALL_MODELS in envmodels:
78              envmodels.append(INSTALL_MODELS)              envmodels.append(INSTALL_MODELS)
79              os.environ['ASCENDLIBRARY'] = SEP.join(envmodels)              os.environ['ASCENDLIBRARY'] = SEP.join(envmodels)
80              restart = 1              restart = 1
81        
82        # if ASCENDSOLVERS has been specified, make sure it includes the standard solvers  
83      if os.environ.get('ASCENDSOLVERS'):      if os.environ.get('ASCENDSOLVERS'):
84          envsolvers = [os.path.abspath(i) for i in os.environ['ASCENDSOLVERS'].split(SEP)]          envsolvers = [os.path.abspath(i) for i in os.environ['ASCENDSOLVERS'].split(SEP)]
85          if not INSTALL_SOLVERS in envsolvers:          if not INSTALL_SOLVERS in envsolvers:
# Line 86  if not os.environ.get('ASC_GDB'): Line 87  if not os.environ.get('ASC_GDB'):
87              os.environ['ASCENDSOLVERS'] = SEP.join(envsolvers)              os.environ['ASCENDSOLVERS'] = SEP.join(envsolvers)
88              restart = 1              restart = 1
89    
90      if restart:      # don't need to restart process on Windows as env vars update immediately
91        if restart and platform.system()!="Windows":
92          print "Restarting with corrected environment..."          print "Restarting with corrected environment..."
93          print "   %s = %s" % (LDPATHVAR,os.environ.get(LDPATHVAR))          print "   %s = %s" % (LDPATHVAR,os.environ.get(LDPATHVAR))
94          print "   ASCENDLIBRARY = %s" % os.environ.get('ASCENDLIBRARY')          print "   ASCENDLIBRARY = %s" % os.environ.get('ASCENDLIBRARY')
# Line 94  if not os.environ.get('ASC_GDB'): Line 96  if not os.environ.get('ASC_GDB'):
96          script = os.path.join(sys.path[0],"ascend")          script = os.path.join(sys.path[0],"ascend")
97          print "PYTHON =",PYTHON          print "PYTHON =",PYTHON
98          print "script =",script          print "script =",script
99          if platform.system()=="Windows":          os.execve(PYTHON,[script] + sys.argv, os.environ)
             print "DROPPING THROUGH"  
         else:  
             os.execve(PYTHON,[script] + sys.argv, os.environ)  
           
100    
101  print "Running with..."  print "Running with..."
102  print "   %s = %s" % (LDPATHVAR, os.environ.get(LDPATHVAR))  print "   %s = %s" % (LDPATHVAR, os.environ.get(LDPATHVAR))
# Line 107  print "   argv = %s" % sys.argv Line 105  print "   argv = %s" % sys.argv
105    
106  if os.environ.get('ASCENDLIBRARY'):  if os.environ.get('ASCENDLIBRARY'):
107      ASCENDLIBRARY = os.environ.get('ASCENDLIBRARY')      ASCENDLIBRARY = os.environ.get('ASCENDLIBRARY')
108      print "USING ASCENDLIBRARY=%s" % ASCENDLIBRARY      print "   ASCENDLIBRARY = %s" % ASCENDLIBRARY
109  else:  
110      ASCENDLIBRARY = DEFAULT_ASCENDLIBRARY  if os.environ.get('ASCENDSOLVERS'):
111      print "default ASCENDLIBRARY=%s" % ASCENDLIBRARY      ASCENDSOLVERS = os.environ.get('ASCENDSOLVERS')
112        print "   ASCENDSOLVERS = %s" % ASCENDLIBRARY
113    
114  print "sys.path[0] = %s" % sys.path[0]  print "sys.path[0] = %s" % sys.path[0]
115    
# Line 135  else: Line 134  else:
134      os.chdir(INSTALL_ASCDATA)      os.chdir(INSTALL_ASCDATA)
135      from gtkbrowser import *      from gtkbrowser import *
136      os.chdir(olddir)      os.chdir(olddir)
137      B = Browser(librarypath=ASCENDLIBRARY,assetspath=os.path.join(INSTALL_ASCDATA,"glade"))      B = Browser(assetspath=os.path.join(INSTALL_ASCDATA,"glade"))
138      B.run()      B.run()

Legend:
Removed from v.1614  
changed lines
  Added in v.1615

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