[Python-checkins] distutils2: Removed bogus uses of sub-commands

tarek.ziade python-checkins at python.org
Thu Jul 15 01:38:06 CEST 2010


tarek.ziade pushed 5b9c3c536275 to distutils2:

http://hg.python.org/distutils2/rev/5b9c3c536275
changeset:   366:5b9c3c536275
user:        Jeremy Kloth <jeremy.kloth at gmail.com>
date:        Thu Jul 08 11:55:56 2010 -0600
summary:     Removed bogus uses of sub-commands
files:       src/distutils2/command/register.py, src/distutils2/command/sdist.py

diff --git a/src/distutils2/command/register.py b/src/distutils2/command/register.py
--- a/src/distutils2/command/register.py
+++ b/src/distutils2/command/register.py
@@ -28,8 +28,6 @@
     boolean_options = PyPIRCCommand.boolean_options + [
         'verify', 'list-classifiers', 'strict']
 
-    sub_commands = [('check', lambda self: True)]
-
     def initialize_options(self):
         PyPIRCCommand.initialize_options(self)
         self.list_classifiers = 0
@@ -46,9 +44,8 @@
         self.finalize_options()
         self._set_config()
 
-        # Run sub commands
-        for cmd_name in self.get_sub_commands():
-            self.run_command(cmd_name)
+        # Check the package metadata
+        self.run_command('check')
 
         if self.dry_run:
             self.verify_metadata()
diff --git a/src/distutils2/command/sdist.py b/src/distutils2/command/sdist.py
--- a/src/distutils2/command/sdist.py
+++ b/src/distutils2/command/sdist.py
@@ -45,12 +45,6 @@
 
     description = "create a source distribution (tarball, zip file, etc.)"
 
-    def checking_metadata(self):
-        """Callable used for the check sub-command.
-
-        Placed here so user_options can view it"""
-        return self.metadata_check
-
     user_options = [
         ('template=', 't',
          "name of manifest template file [default: MANIFEST.in]"),
@@ -100,8 +94,6 @@
     default_format = {'posix': 'gztar',
                       'nt': 'zip' }
 
-    sub_commands = [('check', checking_metadata)]
-
     def initialize_options(self):
         # 'template' and 'manifest' are, respectively, the names of
         # the manifest template and manifest file.
@@ -162,9 +154,9 @@
         # manifest
         self.filelist.clear()
 
-        # Run sub commands
-        for cmd_name in self.get_sub_commands():
-            self.run_command(cmd_name)
+        # Check the package metadata
+        if self.metadata_check:
+            self.run_command('check')
 
         # Do whatever it takes to get the list of files to process
         # (process the manifest template, read an existing manifest,

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list