mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Fixed some goofs in 'alias_options'.
Error message tweak in Command.set_option(). Added Command.get_peer_option(). Added Command.move_file() wrapper.
This commit is contained in:
parent
81ffe75d1c
commit
1ae3246679
1 changed files with 15 additions and 2 deletions
|
@ -120,9 +120,10 @@ class Distribution:
|
||||||
# 'options' dictionary. These aliases are for those common, essential
|
# 'options' dictionary. These aliases are for those common, essential
|
||||||
# options.
|
# options.
|
||||||
alias_options = { 'py_modules': ('build_py', 'modules'),
|
alias_options = { 'py_modules': ('build_py', 'modules'),
|
||||||
'ext_modules': ('build_ext', 'modules'),
|
'ext_modules': ('build_ext', 'extensions'),
|
||||||
'package': [('build_py', 'package',),
|
'package': [('build_py', 'package',),
|
||||||
('build_ext', 'package')],
|
('build_ext', 'package')],
|
||||||
|
'include_dirs': ('build_ext', 'include_dirs'),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,7 +625,7 @@ class Command:
|
||||||
|
|
||||||
if not hasattr (self, option):
|
if not hasattr (self, option):
|
||||||
raise DistutilsOptionError, \
|
raise DistutilsOptionError, \
|
||||||
"command %s: no such option %s" % \
|
"command '%s': no such option '%s'" % \
|
||||||
(self.get_command_name(), option)
|
(self.get_command_name(), option)
|
||||||
if value is not None:
|
if value is not None:
|
||||||
setattr (self, option, value)
|
setattr (self, option, value)
|
||||||
|
@ -701,6 +702,11 @@ class Command:
|
||||||
cmd_obj.set_final_options ()
|
cmd_obj.set_final_options ()
|
||||||
|
|
||||||
|
|
||||||
|
def get_peer_option (self, command, option):
|
||||||
|
cmd_obj = self.distribution.find_command_obj (command)
|
||||||
|
return cmd_obj.get_option (option)
|
||||||
|
|
||||||
|
|
||||||
def run_peer (self, command):
|
def run_peer (self, command):
|
||||||
"""Run some other command: uses the 'run_command()' method of
|
"""Run some other command: uses the 'run_command()' method of
|
||||||
Distribution, which creates the command object if necessary
|
Distribution, which creates the command object if necessary
|
||||||
|
@ -767,6 +773,13 @@ class Command:
|
||||||
self.distribution.dry_run)
|
self.distribution.dry_run)
|
||||||
|
|
||||||
|
|
||||||
|
def move_file (self, src, dst, level=1):
|
||||||
|
"""Move a file respecting verbose and dry-run flags."""
|
||||||
|
return util.move_file (src, dst,
|
||||||
|
self.distribution.verbose >= level,
|
||||||
|
self.distribution.dry_run)
|
||||||
|
|
||||||
|
|
||||||
def make_file (self, infiles, outfile, func, args,
|
def make_file (self, infiles, outfile, func, args,
|
||||||
exec_msg=None, skip_msg=None, level=1):
|
exec_msg=None, skip_msg=None, level=1):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue