mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
General cleanup, raise normalization in Lib/distutils.
This commit is contained in:
parent
a73bfee73d
commit
5b7e9d76f3
47 changed files with 963 additions and 1640 deletions
|
|
@ -81,7 +81,7 @@ class PyDialog(Dialog):
|
|||
Return the button, so that events can be associated"""
|
||||
return self.pushbutton(name, int(self.w*xpos - 28), self.h-27, 56, 17, 3, title, next)
|
||||
|
||||
class bdist_msi (Command):
|
||||
class bdist_msi(Command):
|
||||
|
||||
description = "create a Microsoft Installer (.msi) binary distribution"
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ class bdist_msi (Command):
|
|||
boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
|
||||
'skip-build']
|
||||
|
||||
def initialize_options (self):
|
||||
def initialize_options(self):
|
||||
self.bdist_dir = None
|
||||
self.keep_temp = 0
|
||||
self.no_target_compile = 0
|
||||
|
|
@ -125,7 +125,7 @@ class bdist_msi (Command):
|
|||
self.install_script = None
|
||||
self.pre_install_script = None
|
||||
|
||||
def finalize_options (self):
|
||||
def finalize_options(self):
|
||||
if self.bdist_dir is None:
|
||||
bdist_base = self.get_finalized_command('bdist').bdist_base
|
||||
self.bdist_dir = os.path.join(bdist_base, 'msi')
|
||||
|
|
@ -133,30 +133,29 @@ class bdist_msi (Command):
|
|||
if self.target_version:
|
||||
if not self.skip_build and self.distribution.has_ext_modules()\
|
||||
and self.target_version != short_version:
|
||||
raise DistutilsOptionError, \
|
||||
"target version can only be %s, or the '--skip_build'" \
|
||||
" option must be specified" % (short_version,)
|
||||
raise DistutilsOptionError(
|
||||
"target version can only be %s, or the '--skip_build'"
|
||||
" option must be specified" % (short_version,))
|
||||
else:
|
||||
self.target_version = short_version
|
||||
|
||||
self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
|
||||
|
||||
if self.pre_install_script:
|
||||
raise DistutilsOptionError, "the pre-install-script feature is not yet implemented"
|
||||
raise DistutilsOptionError(
|
||||
"the pre-install-script feature is not yet implemented")
|
||||
|
||||
if self.install_script:
|
||||
for script in self.distribution.scripts:
|
||||
if self.install_script == os.path.basename(script):
|
||||
break
|
||||
else:
|
||||
raise DistutilsOptionError, \
|
||||
"install_script '%s' not found in scripts" % \
|
||||
self.install_script
|
||||
raise DistutilsOptionError(
|
||||
"install_script '%s' not found in scripts"
|
||||
% self.install_script)
|
||||
self.install_script_key = None
|
||||
# finalize_options()
|
||||
|
||||
|
||||
def run (self):
|
||||
def run(self):
|
||||
if not self.skip_build:
|
||||
self.run_command('build')
|
||||
|
||||
|
|
@ -263,7 +262,8 @@ class bdist_msi (Command):
|
|||
key = dir.add_file(file)
|
||||
if file==self.install_script:
|
||||
if self.install_script_key:
|
||||
raise DistutilsOptionError, "Multiple files with name %s" % file
|
||||
raise DistutilsOptionError(
|
||||
"Multiple files with name %s" % file)
|
||||
self.install_script_key = '[#%s]' % key
|
||||
|
||||
cab.commit(db)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue