root / env / lib / python2.7 / site-packages / distribute-0.6.19-py2.7.egg / setuptools / command / bdist_wininst.py @ 1a305335
History | View | Annotate | Download (1.51 KB)
1 | 1a305335 | officers | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst |
---|---|---|---|
2 | import os, sys |
||
3 | |||
4 | class bdist_wininst(_bdist_wininst): |
||
5 | |||
6 | def create_exe(self, arcname, fullname, bitmap=None): |
||
7 | _bdist_wininst.create_exe(self, arcname, fullname, bitmap)
|
||
8 | dist_files = getattr(self.distribution, 'dist_files', []) |
||
9 | |||
10 | if self.target_version: |
||
11 | installer_name = os.path.join(self.dist_dir,
|
||
12 | "%s.win32-py%s.exe" %
|
||
13 | (fullname, self.target_version))
|
||
14 | pyversion = self.target_version
|
||
15 | |||
16 | # fix 2.5 bdist_wininst ignoring --target-version spec
|
||
17 | bad = ('bdist_wininst','any',installer_name) |
||
18 | if bad in dist_files: |
||
19 | dist_files.remove(bad) |
||
20 | else:
|
||
21 | installer_name = os.path.join(self.dist_dir,
|
||
22 | "%s.win32.exe" % fullname)
|
||
23 | pyversion = 'any'
|
||
24 | good = ('bdist_wininst', pyversion, installer_name)
|
||
25 | if good not in dist_files: |
||
26 | dist_files.append(good) |
||
27 | |||
28 | def reinitialize_command (self, command, reinit_subcommands=0): |
||
29 | cmd = self.distribution.reinitialize_command(
|
||
30 | command, reinit_subcommands) |
||
31 | if command in ('install', 'install_lib'): |
||
32 | cmd.install_lib = None # work around distutils bug |
||
33 | return cmd
|
||
34 | |||
35 | def run(self): |
||
36 | self._is_running = True |
||
37 | try:
|
||
38 | _bdist_wininst.run(self)
|
||
39 | finally:
|
||
40 | self._is_running = False |