/[ascend]/trunk/test.py
ViewVC logotype

Diff of /trunk/test.py

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

revision 1105 by johnpye, Wed Jan 10 11:22:20 2007 UTC revision 1106 by johnpye, Wed Jan 10 13:07:45 2007 UTC
# Line 715  if __name__=='__main__': Line 715  if __name__=='__main__':
715          restart = 1          restart = 1
716    
717      if platform.system()=="Windows":      if platform.system()=="Windows":
718          LD_LIBRARY_PATH="PATH"          LD_LIBRARY_PATTH="PATH"
719          SEP = ";"          SEP = ";"
720      else:      else:
721          LD_LIBRARY_PATH="LD_LIBRARY_PATH"          LD_LIBRARY_PATH="LD_LIBRARY_PATH"
# Line 724  if __name__=='__main__': Line 724  if __name__=='__main__':
724      libdirs = ["pygtk","."]      libdirs = ["pygtk","."]
725      libdirs = [os.path.normpath(os.path.join(sys.path[0],l)) for l in libdirs]      libdirs = [os.path.normpath(os.path.join(sys.path[0],l)) for l in libdirs]
726      if not os.environ.get(LD_LIBRARY_PATH):      if not os.environ.get(LD_LIBRARY_PATH):
         #print "Setting %s" % LD_LIBRARY_PATH  
727          os.environ[LD_LIBRARY_PATH]=SEP.join(libdirs)          os.environ[LD_LIBRARY_PATH]=SEP.join(libdirs)
728            restart = 1
729      else:      else:
730          envlibdirs = [os.path.normpath(i) for i in os.environ[LD_LIBRARY_PATH].split(SEP)]          envlibdirs = [os.path.normpath(i) for i in os.environ[LD_LIBRARY_PATH].split(SEP)]
731          for l in libdirs:          for l in libdirs:
732                if l in envlibdirs[len(libdirs):]:
733                    envlibdirs.remove(l)
734                    restart = 1
735            for l in libdirs:
736              if l not in envlibdirs:              if l not in envlibdirs:
737                  envlibdirs.insert(0,l)                  envlibdirs.insert(0,l)
738                  restart = 1                  restart = 1    
739          os.environ[LD_LIBRARY_PATH] = SEP.join(envlibdirs)          os.environ[LD_LIBRARY_PATH] = SEP.join(envlibdirs)
740    
741      pypath = os.path.normpath(os.path.join(sys.path[0],"pygtk"))      pypath = os.path.normpath(os.path.join(sys.path[0],"pygtk"))
# Line 745  if __name__=='__main__': Line 749  if __name__=='__main__':
749    
750      if restart:      if restart:
751          script = os.path.join(sys.path[0],"test.py")          script = os.path.join(sys.path[0],"test.py")
752          print "restarting with script = %s",script          print "Restarting"
753          print "                  argv = %s",sys.argv          print "LD_LIBRARY_PATH = %s" % os.environ.get(LD_LIBRARY_PATH)
754          os.execvp("python",[script] + sys.argv)          os.execvp("python",[script] + sys.argv)
755    
756      import ascpy      import ascpy

Legend:
Removed from v.1105  
changed lines
  Added in v.1106

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