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