898 pathLine = "" |
898 pathLine = "" |
899 path = os.getenv("PATH", "") |
899 path = os.getenv("PATH", "") |
900 if path: |
900 if path: |
901 pybin = os.path.join(sys.exec_prefix, "bin") |
901 pybin = os.path.join(sys.exec_prefix, "bin") |
902 pathlist = path.split(os.pathsep) |
902 pathlist = path.split(os.pathsep) |
903 if pybin not in pathlist: |
903 pathlist_n = [pybin] |
904 pathLine = "PATH={0}{1}{2}\n".format(pybin, os.pathsep, path) |
904 for path_ in pathlist: |
905 else: |
905 if path_ and path_ not in pathlist_n: |
906 pathLine = "PATH={0}\n".format(path) |
906 pathlist_n.append(path_) |
|
907 pathLine = "PATH={0}\n".format(os.pathsep.join(pathlist_n)) |
|
908 |
|
909 # create the wrapper script |
907 wrapper = ('''#!/bin/sh\n''' |
910 wrapper = ('''#!/bin/sh\n''' |
908 '''\n''' |
911 '''\n''' |
909 '''{0}''' |
912 '''{0}''' |
910 '''{1}''' |
913 '''{1}''' |
911 '''exec "{2}" "{3}/{4}.py" "$@"\n''' |
914 '''exec "{2}" "{3}/{4}.py" "$@"\n''' |