Mercurial > p > roundup > code
comparison setup.py @ 1619:7034b61e9d9e
I thought I already made this change...
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 25 Apr 2003 02:09:20 +0000 |
| parents | eee8b5eecb33 |
| children | d0b29215aa44 |
comparison
equal
deleted
inserted
replaced
| 1618:bc43a9677217 | 1619:7034b61e9d9e |
|---|---|
| 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 18 # | 18 # |
| 19 # $Id: setup.py,v 1.49 2003-04-19 05:03:54 richard Exp $ | 19 # $Id: setup.py,v 1.50 2003-04-25 02:09:20 richard Exp $ |
| 20 | 20 |
| 21 from distutils.core import setup, Extension | 21 from distutils.core import setup, Extension |
| 22 from distutils.util import get_platform | 22 from distutils.util import get_platform |
| 23 from distutils.command.build_scripts import build_scripts | 23 from distutils.command.build_scripts import build_scripts |
| 24 | 24 |
| 75 self.announce("would create %s" % outfile) | 75 self.announce("would create %s" % outfile) |
| 76 continue | 76 continue |
| 77 | 77 |
| 78 module = os.path.splitext(os.path.basename(script))[0] | 78 module = os.path.splitext(os.path.basename(script))[0] |
| 79 module = string.translate(module, to_module) | 79 module = string.translate(module, to_module) |
| 80 cmdopt=self.distribution.command_options | |
| 81 if cmdopt['install'].has_key('prefix'): | |
| 82 prefix = cmdopt['install']['prefix'][1] | |
| 83 version = '%d.%d'%sys.version_info[:2] | |
| 84 prefix = ''' | |
| 85 import sys | |
| 86 sys.path.insert(1, "%s/lib/python%s/site-packages") | |
| 87 '''%(prefix, version) | |
| 88 else: | |
| 89 prefix = '' | |
| 80 script_vars = { | 90 script_vars = { |
| 81 'python': os.path.normpath(sys.executable), | 91 'python': os.path.normpath(sys.executable), |
| 82 'package': self.package_name, | 92 'package': self.package_name, |
| 83 'module': module, | 93 'module': module, |
| 94 'prefix': prefix, | |
| 84 } | 95 } |
| 85 | 96 |
| 86 self.announce("creating %s" % outfile) | 97 self.announce("creating %s" % outfile) |
| 87 file = open(outfile, 'w') | 98 file = open(outfile, 'w') |
| 88 | 99 |
| 91 file.write('@echo off\n' | 102 file.write('@echo off\n' |
| 92 'if NOT "%%_4ver%%" == "" "%(python)s" -O -c "from %(package)s.scripts.%(module)s import run; run()" %%$\n' | 103 'if NOT "%%_4ver%%" == "" "%(python)s" -O -c "from %(package)s.scripts.%(module)s import run; run()" %%$\n' |
| 93 'if "%%_4ver%%" == "" "%(python)s" -O -c "from %(package)s.scripts.%(module)s import run; run()" %%*\n' | 104 'if "%%_4ver%%" == "" "%(python)s" -O -c "from %(package)s.scripts.%(module)s import run; run()" %%*\n' |
| 94 % script_vars) | 105 % script_vars) |
| 95 else: | 106 else: |
| 96 file.write('#! %(python)s -O\n' | 107 file.write('#! %(python)s -O\n%(prefix)s' |
| 97 'from %(package)s.scripts.%(module)s import run\n' | 108 'from %(package)s.scripts.%(module)s import run\n' |
| 98 'run()\n' | 109 'run()\n' |
| 99 % script_vars) | 110 % script_vars) |
| 100 finally: | 111 finally: |
| 101 file.close() | 112 file.close() |
