diff options
author | Éric Araujo <merwok@netwok.org> | 2011-11-06 05:54:05 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-11-06 05:54:05 (GMT) |
commit | a963e0d917d71079910d31b69a1cc8a06b74edbe (patch) | |
tree | 25033dfe66a23fc0e41105f81c3aa91c6215675c /Lib/packaging/command | |
parent | 4e377f215d1b4ec7a7a7268a1d4cbd867a45a9ee (diff) | |
download | cpython-a963e0d917d71079910d31b69a1cc8a06b74edbe.zip cpython-a963e0d917d71079910d31b69a1cc8a06b74edbe.tar.gz cpython-a963e0d917d71079910d31b69a1cc8a06b74edbe.tar.bz2 |
Undo potentially confusing name change in packaging.
This method was named reinitialize_command in distutils and accompanied
by a comment suggesting to change it to get_reinitialized_command.
Following that, I did the change for distutils2, but it proved
confusing: The Distribution object has an internal cache of command
objects, to make sure only one instance is ever used, and the name
get_reinitialized_command could suggest that the object returned was
independent of that cache, which it was not. I’m reverting the name
change to make code clearer.
Diffstat (limited to 'Lib/packaging/command')
-rw-r--r-- | Lib/packaging/command/bdist.py | 2 | ||||
-rw-r--r-- | Lib/packaging/command/bdist_dumb.py | 4 | ||||
-rw-r--r-- | Lib/packaging/command/bdist_msi.py | 6 | ||||
-rw-r--r-- | Lib/packaging/command/bdist_wininst.py | 5 | ||||
-rw-r--r-- | Lib/packaging/command/cmd.py | 4 | ||||
-rw-r--r-- | Lib/packaging/command/test.py | 2 |
6 files changed, 11 insertions, 12 deletions
diff --git a/Lib/packaging/command/bdist.py b/Lib/packaging/command/bdist.py index b9d550b..e390cdc 100644 --- a/Lib/packaging/command/bdist.py +++ b/Lib/packaging/command/bdist.py @@ -126,7 +126,7 @@ class bdist(Command): # Reinitialize and run each command. for i in range(len(self.formats)): cmd_name = commands[i] - sub_cmd = self.get_reinitialized_command(cmd_name) + sub_cmd = self.reinitialize_command(cmd_name) sub_cmd.format = self.formats[i] # passing the owner and group names for tar archiving diff --git a/Lib/packaging/command/bdist_dumb.py b/Lib/packaging/command/bdist_dumb.py index 309f64f..548e3c4 100644 --- a/Lib/packaging/command/bdist_dumb.py +++ b/Lib/packaging/command/bdist_dumb.py @@ -80,8 +80,8 @@ class bdist_dumb(Command): if not self.skip_build: self.run_command('build') - install = self.get_reinitialized_command('install_dist', - reinit_subcommands=True) + install = self.reinitialize_command('install_dist', + reinit_subcommands=True) install.root = self.bdist_dir install.skip_build = self.skip_build install.warn_dir = False diff --git a/Lib/packaging/command/bdist_msi.py b/Lib/packaging/command/bdist_msi.py index 9c1791f..4f8eca6 100644 --- a/Lib/packaging/command/bdist_msi.py +++ b/Lib/packaging/command/bdist_msi.py @@ -183,13 +183,13 @@ class bdist_msi(Command): if not self.skip_build: self.run_command('build') - install = self.get_reinitialized_command('install_dist', - reinit_subcommands=True) + install = self.reinitialize_command('install_dist', + reinit_subcommands=True) install.prefix = self.bdist_dir install.skip_build = self.skip_build install.warn_dir = False - install_lib = self.get_reinitialized_command('install_lib') + install_lib = self.reinitialize_command('install_lib') # we do not want to include pyc or pyo files install_lib.compile = False install_lib.optimize = 0 diff --git a/Lib/packaging/command/bdist_wininst.py b/Lib/packaging/command/bdist_wininst.py index 6c1e225..4e6b79e 100644 --- a/Lib/packaging/command/bdist_wininst.py +++ b/Lib/packaging/command/bdist_wininst.py @@ -115,14 +115,13 @@ class bdist_wininst(Command): if not self.skip_build: self.run_command('build') - install = self.get_reinitialized_command('install', - reinit_subcommands=True) + install = self.reinitialize_command('install', reinit_subcommands=True) install.root = self.bdist_dir install.skip_build = self.skip_build install.warn_dir = False install.plat_name = self.plat_name - install_lib = self.get_reinitialized_command('install_lib') + install_lib = self.reinitialize_command('install_lib') # we do not want to include pyc or pyo files install_lib.compile = False install_lib.optimize = 0 diff --git a/Lib/packaging/command/cmd.py b/Lib/packaging/command/cmd.py index 1053ac3..a88df02 100644 --- a/Lib/packaging/command/cmd.py +++ b/Lib/packaging/command/cmd.py @@ -318,8 +318,8 @@ class Command: cmd_obj.ensure_finalized() return cmd_obj - def get_reinitialized_command(self, command, reinit_subcommands=False): - return self.distribution.get_reinitialized_command( + def reinitialize_command(self, command, reinit_subcommands=False): + return self.distribution.reinitialize_command( command, reinit_subcommands) def run_command(self, command): diff --git a/Lib/packaging/command/test.py b/Lib/packaging/command/test.py index 7f9015b..5b62a12 100644 --- a/Lib/packaging/command/test.py +++ b/Lib/packaging/command/test.py @@ -56,7 +56,7 @@ class test(Command): prev_syspath = sys.path[:] try: # build release - build = self.get_reinitialized_command('build') + build = self.reinitialize_command('build') self.run_command('build') sys.path.insert(0, build.build_lib) |