mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Renamed many options to be consistent across commands.
Tweaked some help strings to be consistent with documentation. Don't call 'set_final_options()' in 'run()' anymore -- that's now guaranteed to be taken care of for us by the Distribution instance.
This commit is contained in:
parent
df178f97de
commit
e6ac2fcc12
5 changed files with 35 additions and 41 deletions
|
@ -8,7 +8,7 @@ from distutils.util import copy_tree
|
|||
|
||||
class InstallPy (Command):
|
||||
|
||||
options = [('dir=', 'd', "directory to install to"),
|
||||
options = [('install-dir=', 'd', "directory to install to"),
|
||||
('build-dir=','b', "build directory (where to install from)"),
|
||||
('compile', 'c', "compile .py to .pyc"),
|
||||
('optimize', 'o', "compile .py to .pyo (optimized)"),
|
||||
|
@ -17,7 +17,7 @@ class InstallPy (Command):
|
|||
|
||||
def set_default_options (self):
|
||||
# let the 'install' command dictate our installation directory
|
||||
self.dir = None
|
||||
self.install_dir = None
|
||||
self.build_dir = None
|
||||
self.compile = 1
|
||||
self.optimize = 1
|
||||
|
@ -39,18 +39,16 @@ class InstallPy (Command):
|
|||
# install (target) directory, and whether to compile .py files.
|
||||
self.set_undefined_options ('install',
|
||||
('build_lib', 'build_dir'),
|
||||
(dir_option, 'dir'),
|
||||
(dir_option, 'install_dir'),
|
||||
('compile_py', 'compile'),
|
||||
('optimize_py', 'optimize'))
|
||||
|
||||
|
||||
def run (self):
|
||||
|
||||
self.set_final_options ()
|
||||
|
||||
# Dump entire contents of the build directory to the installation
|
||||
# directory (that's the beauty of having a build directory!)
|
||||
outfiles = self.copy_tree (self.build_dir, self.dir)
|
||||
outfiles = self.copy_tree (self.build_dir, self.install_dir)
|
||||
|
||||
# (Optionally) compile .py to .pyc
|
||||
# XXX hey! we can't control whether we optimize or not; that's up
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue