Changeset 1209 for tags


Ignore:
Timestamp:
08/29/06 16:11:34 (18 years ago)
Author:
mar637
Message:

allow auto-insertion of PYTHONPATH

Location:
tags/Release2.1.0b/bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/Release2.1.0b/bin/asap

    r1080 r1209  
    3232[ -x /usr/bin/clear ] && /usr/bin/clear
    3333
     34# do not remove this line it gets replaced on install with custom moduledir
     35# **PYTHONPATH**
     36
    3437echo "Loading ASAP..."
    3538
  • tags/Release2.1.0b/bin/install

    r1195 r1209  
    4545execprefix = dist.EXEC_PREFIX
    4646moduledir = dist.get_python_lib()
     47sysmoduledir = moduledir
    4748for k, v in opts:
    4849    if k in ("-h", "--help"):
     
    118119    shutil.copytree("asap", moddir)
    119120    print "Installing asap  scripts in %s" % bindir
    120     shutil.copy2("bin/asap", bindir)
     121    if moduledir != sysmoduledir:
     122        import sre
     123        print "Changing asap startup script to use custom PYTHONPATH"
     124        inf = file("bin/asap")
     125        outf = file(os.path.join(bindir,"asap"), "w")
     126        outline = "export PYTHONPATH=%s" % moduledir
     127        regx = sre.compile("\*\*PYTHONPATH\*\*")
     128        for line in inf.readlines():
     129            if regx.search(line):
     130                line = outline
     131            outf.write(line)
     132        outf.close()
     133        os.chmod(os.path.join(bindir,"asap"), 0755)
     134    else:
     135        shutil.copy2("bin/asap", bindir)
    121136    shutil.copy2("bin/asap_update_data", bindir)
    122137    if not os.path.exists("asap/data/ephemerides"):
Note: See TracChangeset for help on using the changeset viewer.