[Python-checkins] python/dist/src/Lib/distutils archive_util.py,1.11,1.12 bcppcompiler.py,1.11,1.12 ccompiler.py,1.43,1.44 cmd.py,1.29,1.30 core.py,1.47,1.48 cygwinccompiler.py,1.14,1.15 dir_util.py,1.8,1.9 dist.py,1.53,1.54 emxccompiler.py,1.1,1.2 fancy_getopt.py,1.20,1.21 file_util.py,1.12,1.13 filelist.py,1.9,1.10 msvccompiler.py,1.46,1.47 mwerkscompiler.py,1.6,1.7 spawn.py,1.12,1.13 unixccompiler.py,1.39,1.40 util.py,1.67,1.68

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Tue, 04 Jun 2002 13:14:45 -0700


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory usw-pr-cvs1:/tmp/cvs-serv6520

Modified Files:
	archive_util.py bcppcompiler.py ccompiler.py cmd.py core.py 
	cygwinccompiler.py dir_util.py dist.py emxccompiler.py 
	fancy_getopt.py file_util.py filelist.py msvccompiler.py 
	mwerkscompiler.py spawn.py unixccompiler.py util.py 
Log Message:
Make setup.py less chatty by default.

This is a conservative version of SF patch 504889.  It uses the log
module instead of calling print in various places, and it ignores the
verbose argument passed to many functions and set as an attribute on
some objects.  Instead, it uses the verbosity set on the logger via
the command line.

The log module is now preferred over announce() and warn() methods
that exist only for backwards compatibility.

XXX This checkin changes a lot of modules that have no test suite and
aren't exercised by the Python build process.  It will need
substantial testing.




Index: archive_util.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/archive_util.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** archive_util.py	6 Dec 2001 20:51:35 -0000	1.11
--- archive_util.py	4 Jun 2002 20:14:42 -0000	1.12
***************
*** 12,15 ****
--- 12,16 ----
  from distutils.spawn import spawn
  from distutils.dir_util import mkpath
+ from distutils import log
  
  def make_tarball (base_name, base_dir, compress="gzip",
***************
*** 43,53 ****
  
      archive_name = base_name + ".tar"
!     mkpath(os.path.dirname(archive_name), verbose=verbose, dry_run=dry_run)
      cmd = ["tar", "-cf", archive_name, base_dir]
!     spawn(cmd, verbose=verbose, dry_run=dry_run)
  
      if compress:
          spawn([compress] + compress_flags[compress] + [archive_name],
!               verbose=verbose, dry_run=dry_run)
          return archive_name + compress_ext[compress]
      else:
--- 44,54 ----
  
      archive_name = base_name + ".tar"
!     mkpath(os.path.dirname(archive_name), dry_run=dry_run)
      cmd = ["tar", "-cf", archive_name, base_dir]
!     spawn(cmd, dry_run=dry_run)
  
      if compress:
          spawn([compress] + compress_flags[compress] + [archive_name],
!               dry_run=dry_run)
          return archive_name + compress_ext[compress]
      else:
***************
*** 70,77 ****
  
      zip_filename = base_name + ".zip"
!     mkpath(os.path.dirname(zip_filename), verbose=verbose, dry_run=dry_run)
      try:
          spawn(["zip", "-rq", zip_filename, base_dir],
!               verbose=verbose, dry_run=dry_run)
      except DistutilsExecError:
  
--- 71,78 ----
  
      zip_filename = base_name + ".zip"
!     mkpath(os.path.dirname(zip_filename), dry_run=dry_run)
      try:
          spawn(["zip", "-rq", zip_filename, base_dir],
!               dry_run=dry_run)
      except DistutilsExecError:
  
***************
*** 90,97 ****
                     "import the 'zipfile' module") % zip_filename
  
!         if verbose:
!             print "creating '%s' and adding '%s' to it" % \
!                   (zip_filename, base_dir)
! 
          def visit (z, dirname, names):
              for name in names:
--- 91,98 ----
                     "import the 'zipfile' module") % zip_filename
  
!         
!         log.info("creating '%s' and adding '%s' to it", 
!                  zip_filename, base_dir)
!          
          def visit (z, dirname, names):
              for name in names:
***************
*** 142,147 ****
      save_cwd = os.getcwd()
      if root_dir is not None:
!         if verbose:
!             print "changing into '%s'" % root_dir
          base_name = os.path.abspath(base_name)
          if not dry_run:
--- 143,147 ----
      save_cwd = os.getcwd()
      if root_dir is not None:
!         log.debug("changing into '%s'", root_dir)
          base_name = os.path.abspath(base_name)
          if not dry_run:
***************
*** 151,156 ****
          base_dir = os.curdir
  
!     kwargs = { 'verbose': verbose,
!                'dry_run': dry_run }
  
      try:
--- 151,155 ----
          base_dir = os.curdir
  
!     kwargs = { 'dry_run': dry_run }
  
      try:
***************
*** 165,170 ****
  
      if root_dir is not None:
!         if verbose:
!             print "changing back to '%s'" % save_cwd
          os.chdir(save_cwd)
  
--- 164,168 ----
  
      if root_dir is not None:
!         log.debug("changing back to '%s'", save_cwd)
          os.chdir(save_cwd)
  

Index: bcppcompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/bcppcompiler.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** bcppcompiler.py	6 Dec 2001 20:51:35 -0000	1.11
--- bcppcompiler.py	4 Jun 2002 20:14:42 -0000	1.12
***************
*** 23,26 ****
--- 23,27 ----
  from distutils.file_util import write_file
  from distutils.dep_util import newer
+ from distutils import log
  
  class BCPPCompiler(CCompiler) :
***************
*** 109,113 ****
  
              if skip_sources[src]:
!                 self.announce ("skipping %s (%s up-to-date)" % (src, obj))
              else:
                  src = os.path.normpath(src)
--- 110,114 ----
  
              if skip_sources[src]:
!                 log.debug("skipping %s (%s up-to-date)", src, obj)
              else:
                  src = os.path.normpath(src)
***************
*** 179,183 ****
                  raise LibError, msg
          else:
!             self.announce ("skipping %s (up-to-date)" % output_filename)
  
      # create_static_lib ()
--- 180,184 ----
                  raise LibError, msg
          else:
!             log.debug("skipping %s (up-to-date)", output_filename)
  
      # create_static_lib ()
***************
*** 206,211 ****
  
          if runtime_library_dirs:
!             self.warn ("I don't know what to do with 'runtime_library_dirs': "
!                        + str (runtime_library_dirs))
  
          if output_dir is not None:
--- 207,212 ----
  
          if runtime_library_dirs:
!             log.warn("I don't know what to do with 'runtime_library_dirs': %s",
!                      str(runtime_library_dirs))
  
          if output_dir is not None:
***************
*** 286,290 ****
                      ld_args.append(lib)
                      # probably a BCPP internal library -- don't warn
-                     #    self.warn('library %s not found.' % lib)
                  else:
                      # full name which prefers bcpp_xxx.lib over xxx.lib
--- 287,290 ----
***************
*** 314,318 ****
  
          else:
!             self.announce ("skipping %s (up-to-date)" % output_filename)
  
      # link ()
--- 314,318 ----
  
          else:
!             log.debug("skipping %s (up-to-date)", output_filename)
  
      # link ()

Index: ccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/ccompiler.py,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** ccompiler.py	25 Apr 2002 17:03:30 -0000	1.43
--- ccompiler.py	4 Jun 2002 20:14:42 -0000	1.44
***************
*** 17,21 ****
  from distutils.dep_util import newer_pairwise, newer_group
  from distutils.util import split_quoted, execute
! 
  
  class CCompiler:
--- 17,21 ----
  from distutils.dep_util import newer_pairwise, newer_group
  from distutils.util import split_quoted, execute
! from distutils import log
  
  class CCompiler:
***************
*** 81,85 ****
                    force=0):
  
-         self.verbose = verbose
          self.dry_run = dry_run
          self.force = force
--- 81,84 ----
***************
*** 809,814 ****
  
      def announce (self, msg, level=1):
!         if self.verbose >= level:
!             print msg
  
      def debug_print (self, msg):
--- 808,812 ----
  
      def announce (self, msg, level=1):
!         log.debug(msg)
  
      def debug_print (self, msg):
***************
*** 821,834 ****
  
      def execute (self, func, args, msg=None, level=1):
!         execute(func, args, msg, self.verbose >= level, self.dry_run)
  
      def spawn (self, cmd):
!         spawn (cmd, verbose=self.verbose, dry_run=self.dry_run)
  
      def move_file (self, src, dst):
!         return move_file (src, dst, verbose=self.verbose, dry_run=self.dry_run)
  
      def mkpath (self, name, mode=0777):
!         mkpath (name, mode, self.verbose, self.dry_run)
  
  
--- 819,832 ----
  
      def execute (self, func, args, msg=None, level=1):
!         execute(func, args, msg, self.dry_run)
  
      def spawn (self, cmd):
!         spawn (cmd, dry_run=self.dry_run)
  
      def move_file (self, src, dst):
!         return move_file (src, dst, dry_run=self.dry_run)
  
      def mkpath (self, name, mode=0777):
!         mkpath (name, mode, self.dry_run)
  
  
***************
*** 958,962 ****
                 "in module '%s'") % (class_name, module_name)
  
!     return klass (verbose, dry_run, force)
  
  
--- 956,963 ----
                 "in module '%s'") % (class_name, module_name)
  
!     # XXX The None is necessary to preserve backwards compatibility
!     # with classes that expect verbose to be the first positional
!     # argument.
!     return klass (None, dry_run, force)
  
  

Index: cmd.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/cmd.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** cmd.py	6 Dec 2001 20:51:35 -0000	1.29
--- cmd.py	4 Jun 2002 20:14:42 -0000	1.30
***************
*** 14,18 ****
  from distutils.errors import *
  from distutils import util, dir_util, file_util, archive_util, dep_util
! 
  
  class Command:
--- 14,18 ----
  from distutils.errors import *
  from distutils import util, dir_util, file_util, archive_util, dep_util
! from distutils import log
  
  class Command:
***************
*** 73,81 ****
          # "not defined, check self.distribution's copy", while 0 or 1 mean
          # false and true (duh).  Note that this means figuring out the real
!         # value of each flag is a touch complicated -- hence "self.verbose"
!         # (etc.) will be handled by __getattr__, below.
!         self._verbose = None
          self._dry_run = None
  
          # Some commands define a 'self.force' option to ignore file
          # timestamps, but methods defined *here* assume that
--- 73,85 ----
          # "not defined, check self.distribution's copy", while 0 or 1 mean
          # false and true (duh).  Note that this means figuring out the real
!         # value of each flag is a touch complicated -- hence "self._dry_run"
!         # will be handled by __getattr__, below.
!         # XXX This needs to be fixed.
          self._dry_run = None
  
+         # verbose is largely ignored, but needs to be set for
+         # backwards compatibility (I think)?
+         self.verbose = dist.verbose
+         
          # Some commands define a 'self.force' option to ignore file
          # timestamps, but methods defined *here* assume that
***************
*** 97,102 ****
  
  
      def __getattr__ (self, attr):
!         if attr in ('verbose', 'dry_run'):
              myval = getattr(self, "_" + attr)
              if myval is None:
--- 101,108 ----
  
  
+     # XXX A more explicit way to customize dry_run would be better.
+     
      def __getattr__ (self, attr):
!         if attr == 'dry_run':
              myval = getattr(self, "_" + attr)
              if myval is None:
***************
*** 187,193 ****
          'level' print 'msg' to stdout.
          """
!         if self.verbose >= level:
!             print msg
!             sys.stdout.flush()
  
      def debug_print (self, msg):
--- 193,197 ----
          'level' print 'msg' to stdout.
          """
!         log.debug(msg)
  
      def debug_print (self, msg):
***************
*** 353,362 ****
  
      def execute (self, func, args, msg=None, level=1):
!         util.execute(func, args, msg, self.verbose >= level, self.dry_run)
  
  
      def mkpath (self, name, mode=0777):
!         dir_util.mkpath(name, mode,
!                         self.verbose, self.dry_run)
  
  
--- 357,365 ----
  
      def execute (self, func, args, msg=None, level=1):
!         util.execute(func, args, msg, dry_run=self.dry_run)
  
  
      def mkpath (self, name, mode=0777):
!         dir_util.mkpath(name, mode, dry_run=self.dry_run)
  
  
***************
*** 372,377 ****
              not self.force,
              link,
!             self.verbose >= level,
!             self.dry_run)
  
  
--- 375,379 ----
              not self.force,
              link,
!             dry_run=self.dry_run)
  
  
***************
*** 386,413 ****
              preserve_mode,preserve_times,preserve_symlinks,
              not self.force,
!             self.verbose >= level,
!             self.dry_run)
! 
  
      def move_file (self, src, dst, level=1):
!         """Move a file respecting verbose and dry-run flags."""
!         return file_util.move_file(src, dst,
!                                    self.verbose >= level,
!                                    self.dry_run)
! 
  
      def spawn (self, cmd, search_path=1, level=1):
!         """Spawn an external command respecting verbose and dry-run flags."""
          from distutils.spawn import spawn
!         spawn(cmd, search_path,
!               self.verbose >= level,
!               self.dry_run)
! 
  
      def make_archive (self, base_name, format,
                        root_dir=None, base_dir=None):
          return archive_util.make_archive(
!             base_name, format, root_dir, base_dir,
!             self.verbose, self.dry_run)
  
  
--- 388,406 ----
              preserve_mode,preserve_times,preserve_symlinks,
              not self.force,
!             dry_run=self.dry_run)
  
      def move_file (self, src, dst, level=1):
!         """Move a file respectin dry-run flag."""
!         return file_util.move_file(src, dst, dry_run = self.dry_run)
  
      def spawn (self, cmd, search_path=1, level=1):
!         """Spawn an external command respecting dry-run flag."""
          from distutils.spawn import spawn
!         spawn(cmd, search_path, dry_run= self.dry_run)
  
      def make_archive (self, base_name, format,
                        root_dir=None, base_dir=None):
          return archive_util.make_archive(
!             base_name, format, root_dir, base_dir, dry_run=self.dry_run)
  
  
***************
*** 444,448 ****
          # Otherwise, print the "skip" message
          else:
!             self.announce(skip_msg, level)
  
      # make_file ()
--- 437,441 ----
          # Otherwise, print the "skip" message
          else:
!             log.debug(skip_msg)
  
      # make_file ()

Index: core.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/core.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** core.py	6 Dec 2001 20:51:35 -0000	1.47
--- core.py	4 Jun 2002 20:14:42 -0000	1.48
***************
*** 101,105 ****
          _setup_distribution = dist = klass(attrs)
      except DistutilsSetupError, msg:
!         raise SystemExit, "error in setup script: %s" % msg
  
      if _setup_stop_after == "init":
--- 101,109 ----
          _setup_distribution = dist = klass(attrs)
      except DistutilsSetupError, msg:
!         if attrs.has_key('name'):
!             raise SystemExit, "error in %s setup command: %s" % \
!                   (attrs['name'], msg)
!         else:
!             raise SystemExit, "error in setup command: %s" % msg
  
      if _setup_stop_after == "init":

Index: cygwinccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/cygwinccompiler.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** cygwinccompiler.py	6 Dec 2001 20:51:35 -0000	1.14
--- cygwinccompiler.py	4 Jun 2002 20:14:42 -0000	1.15
***************
*** 51,54 ****
--- 51,55 ----
  from distutils.file_util import write_file
  from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
+ from distutils import log
  
  class CygwinCCompiler (UnixCCompiler):
***************
*** 149,153 ****
              ext = (os.path.splitext (src))[1]
              if skip_sources[src]:
!                 self.announce ("skipping %s (%s up-to-date)" % (src, obj))
              else:
                  self.mkpath (os.path.dirname (obj))
--- 150,154 ----
              ext = (os.path.splitext (src))[1]
              if skip_sources[src]:
!                 log.debug("skipping %s (%s up-to-date)", src, obj)
              else:
                  self.mkpath (os.path.dirname (obj))

Index: dir_util.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dir_util.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** dir_util.py	6 Dec 2001 20:51:35 -0000	1.8
--- dir_util.py	4 Jun 2002 20:14:42 -0000	1.9
***************
*** 10,14 ****
  from types import *
  from distutils.errors import DistutilsFileError, DistutilsInternalError
! 
  
  # cache for by mkpath() -- in addition to cheapening redundant calls,
--- 10,14 ----
  from types import *
  from distutils.errors import DistutilsFileError, DistutilsInternalError
! from distutils import log
  
  # cache for by mkpath() -- in addition to cheapening redundant calls,
***************
*** 70,75 ****
              continue
  
!         if verbose:
!             print "creating", head
  
          if not dry_run:
--- 70,74 ----
              continue
  
!         log.info("creating %s", head)
  
          if not dry_run:
***************
*** 106,110 ****
      # Now create them
      for dir in need_dirs:
!         mkpath(dir, mode, verbose, dry_run)
  
  # create_tree ()
--- 105,109 ----
      # Now create them
      for dir in need_dirs:
!         mkpath(dir, mode, dry_run=dry_run)
  
  # create_tree ()
***************
*** 152,156 ****
  
      if not dry_run:
!         mkpath(dst, verbose=verbose)
  
      outputs = []
--- 151,155 ----
  
      if not dry_run:
!         mkpath(dst)
  
      outputs = []
***************
*** 162,167 ****
          if preserve_symlinks and os.path.islink(src_name):
              link_dest = os.readlink(src_name)
!             if verbose:
!                 print "linking %s -> %s" % (dst_name, link_dest)
              if not dry_run:
                  os.symlink(link_dest, dst_name)
--- 161,165 ----
          if preserve_symlinks and os.path.islink(src_name):
              link_dest = os.readlink(src_name)
!             log.info("linking %s -> %s", dst_name, link_dest)
              if not dry_run:
                  os.symlink(link_dest, dst_name)
***************
*** 170,180 ****
          elif os.path.isdir(src_name):
              outputs.extend(
!                 copy_tree(src_name, dst_name,
!                           preserve_mode, preserve_times, preserve_symlinks,
!                           update, verbose, dry_run))
          else:
!             copy_file(src_name, dst_name,
!                       preserve_mode, preserve_times,
!                       update, None, verbose, dry_run)
              outputs.append(dst_name)
  
--- 168,177 ----
          elif os.path.isdir(src_name):
              outputs.extend(
!                 copy_tree(src_name, dst_name, preserve_mode,
!                           preserve_times, preserve_symlinks, update,
!                           dry_run=dry_run))
          else:
!             copy_file(src_name, dst_name, preserve_mode,
!                       preserve_times, update, dry_run=dry_run)
              outputs.append(dst_name)
  
***************
*** 201,206 ****
      global _path_created
  
!     if verbose:
!         print "removing '%s' (and everything under it)" % directory
      if dry_run:
          return
--- 198,202 ----
      global _path_created
  
!     log.info("removing '%s' (and everything under it)", directory)
      if dry_run:
          return
***************
*** 215,219 ****
                  del _path_created[abspath]
          except (IOError, OSError), exc:
!             if verbose:
!                 print grok_environment_error(
!                     exc, "error removing %s: " % directory)
--- 211,214 ----
                  del _path_created[abspath]
          except (IOError, OSError), exc:
!             log.warn(grok_environment_error(
!                     exc, "error removing %s: " % directory))

Index: dist.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dist.py,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** dist.py	6 Dec 2001 20:51:35 -0000	1.53
--- dist.py	4 Jun 2002 20:14:42 -0000	1.54
***************
*** 16,20 ****
  from distutils.fancy_getopt import FancyGetopt, translate_longopt
  from distutils.util import check_environ, strtobool, rfc822_escape
! 
  
  # Regex to define acceptable Distutils command names.  This is not *quite*
--- 16,20 ----
  from distutils.fancy_getopt import FancyGetopt, translate_longopt
  from distutils.util import check_environ, strtobool, rfc822_escape
! from distutils import log
  
  # Regex to define acceptable Distutils command names.  This is not *quite*
***************
*** 47,51 ****
      # don't want to pollute the commands with too many options that they
      # have minimal control over.
!     global_options = [('verbose', 'v', "run verbosely (default)"),
                        ('quiet', 'q', "run quietly (turns verbosity off)"),
                        ('dry-run', 'n', "don't actually do anything"),
--- 47,52 ----
      # don't want to pollute the commands with too many options that they
      # have minimal control over.
!     # The fourth entry for verbose means that it can be repeated.
!     global_options = [('verbose', 'v', "run verbosely (default)", 1),
                        ('quiet', 'q', "run quietly (turns verbosity off)"),
                        ('dry-run', 'n', "don't actually do anything"),
***************
*** 393,396 ****
--- 394,398 ----
          args = parser.getopt(args=self.script_args, object=self)
          option_order = parser.get_option_order()
+         log.set_verbosity(self.verbose)
  
          # for display options we return immediately
***************
*** 877,887 ****
  
      def announce (self, msg, level=1):
!         """Print 'msg' if 'level' is greater than or equal to the verbosity
!         level recorded in the 'verbose' attribute (which, currently, can be
!         only 0 or 1).
!         """
!         if self.verbose >= level:
!             print msg
! 
  
      def run_commands (self):
--- 879,883 ----
  
      def announce (self, msg, level=1):
!         log.debug(msg)
  
      def run_commands (self):
***************
*** 908,912 ****
              return
  
!         self.announce("running " + command)
          cmd_obj = self.get_command_obj(command)
          cmd_obj.ensure_finalized()
--- 904,908 ----
              return
  
!         log.info("running %s", command)
          cmd_obj = self.get_command_obj(command)
          cmd_obj.ensure_finalized()

Index: emxccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/emxccompiler.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** emxccompiler.py	6 Feb 2002 18:22:48 -0000	1.1
--- emxccompiler.py	4 Jun 2002 20:14:42 -0000	1.2
***************
*** 29,32 ****
--- 29,33 ----
  from distutils.file_util import write_file
  from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
+ from distutils import log
  
  class EMXCCompiler (UnixCCompiler):
***************
*** 110,114 ****
              ext = (os.path.splitext (src))[1]
              if skip_sources[src]:
!                 self.announce ("skipping %s (%s up-to-date)" % (src, obj))
              else:
                  self.mkpath (os.path.dirname (obj))
--- 111,115 ----
              ext = (os.path.splitext (src))[1]
              if skip_sources[src]:
!                 log.debug("skipping %s (%s up-to-date)", src, obj)
              else:
                  self.mkpath (os.path.dirname (obj))

Index: fancy_getopt.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/fancy_getopt.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** fancy_getopt.py	6 Dec 2001 20:51:35 -0000	1.20
--- fancy_getopt.py	4 Jun 2002 20:14:42 -0000	1.21
***************
*** 158,168 ****
          self.short_opts = []
          self.short2long.clear()
  
          for option in self.option_table:
!             try:
!                 (long, short, help) = option
!             except ValueError:
!                 raise DistutilsGetoptError, \
!                       "invalid option tuple " + str(option)
  
              # Type- and value-check the option names
--- 158,173 ----
          self.short_opts = []
          self.short2long.clear()
+         self.repeat = {}
  
          for option in self.option_table:
!             if len(option) == 3:
!                 long, short, help = option
!                 repeat = 0
!             elif len(option) == 4:
!                 long, short, help, repeat = option
!             else:
!                 # the option table is part of the code, so simply
!                 # assert that it is correct
!                 assert "invalid option tuple: %s" % `option`
  
              # Type- and value-check the option names
***************
*** 178,181 ****
--- 183,187 ----
                         "must a single character or None") % short
  
+             self.repeat[long] = 1
              self.long_opts.append(long)
  
***************
*** 233,244 ****
  
      def getopt (self, args=None, object=None):
!         """Parse the command-line options in 'args' and store the results
!         as attributes of 'object'.  If 'args' is None or not supplied, uses
!         'sys.argv[1:]'.  If 'object' is None or not supplied, creates a new
!         OptionDummy object, stores option values there, and returns a tuple
!         (args, object).  If 'object' is supplied, it is modified in place
!         and 'getopt()' just returns 'args'; in both cases, the returned
!         'args' is a modified copy of the passed-in 'args' list, which is
!         left untouched.
          """
          if args is None:
--- 239,251 ----
  
      def getopt (self, args=None, object=None):
!         """Parse command-line options in args. Store as attributes on object.
! 
!         If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
!         'object' is None or not supplied, creates a new OptionDummy
!         object, stores option values there, and returns a tuple (args,
!         object).  If 'object' is supplied, it is modified in place and
!         'getopt()' just returns 'args'; in both cases, the returned
!         'args' is a modified copy of the passed-in 'args' list, which
!         is left untouched.
          """
          if args is None:
***************
*** 254,271 ****
          short_opts = string.join(self.short_opts)
          try:
!             (opts, args) = getopt.getopt(args, short_opts, self.long_opts)
          except getopt.error, msg:
              raise DistutilsArgError, msg
  
!         for (opt, val) in opts:
              if len(opt) == 2 and opt[0] == '-': # it's a short option
                  opt = self.short2long[opt[1]]
- 
-             elif len(opt) > 2 and opt[0:2] == '--':
-                 opt = opt[2:]
- 
              else:
!                 raise DistutilsInternalError, \
!                       "this can't happen: bad option string '%s'" % opt
  
              alias = self.alias.get(opt)
--- 261,274 ----
          short_opts = string.join(self.short_opts)
          try:
!             opts, args = getopt.getopt(args, short_opts, self.long_opts)
          except getopt.error, msg:
              raise DistutilsArgError, msg
  
!         for opt, val in opts:
              if len(opt) == 2 and opt[0] == '-': # it's a short option
                  opt = self.short2long[opt[1]]
              else:
!                 assert len(opt) > 2 and opt[:2] == '--'
!                 opt = opt[2:]
  
              alias = self.alias.get(opt)
***************
*** 274,281 ****
  
              if not self.takes_arg[opt]:     # boolean option?
!                 if val != '':               # shouldn't have a value!
!                     raise DistutilsInternalError, \
!                           "this can't happen: bad option value '%s'" % val
! 
                  alias = self.negative_alias.get(opt)
                  if alias:
--- 277,281 ----
  
              if not self.takes_arg[opt]:     # boolean option?
!                 assert val == '', "boolean option can't have value"
                  alias = self.negative_alias.get(opt)
                  if alias:
***************
*** 286,296 ****
  
              attr = self.attr_name[opt]
              setattr(object, attr, val)
              self.option_order.append((opt, val))
  
          # for opts
- 
          if created_object:
!             return (args, object)
          else:
              return args
--- 286,299 ----
  
              attr = self.attr_name[opt]
+             # The only repeating option at the moment is 'verbose'.
+             # It has a negative option -q quiet, which should set verbose = 0.
+             if val and self.repeat.get(attr) is not None:
+                 val = getattr(object, attr, 0) + 1
              setattr(object, attr, val)
              self.option_order.append((opt, val))
  
          # for opts
          if created_object:
!             return args, object
          else:
              return args

Index: file_util.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/file_util.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** file_util.py	1 Feb 2002 18:29:34 -0000	1.12
--- file_util.py	4 Jun 2002 20:14:42 -0000	1.13
***************
*** 10,14 ****
  import os
  from distutils.errors import DistutilsFileError
! 
  
  # for generating verbose output in 'copy_file()'
--- 10,14 ----
  import os
  from distutils.errors import DistutilsFileError
! from distutils import log
  
  # for generating verbose output in 'copy_file()'
***************
*** 74,78 ****
  # _copy_file_contents()
  
- 
  def copy_file (src, dst,
                 preserve_mode=1,
--- 74,77 ----
***************
*** 91,96 ****
      last-access times are copied as well.  If 'update' is true, 'src' will
      only be copied if 'dst' does not exist, or if 'dst' does exist but is
!     older than 'src'.  If 'verbose' is true, then a one-line summary of the
!     copy will be printed to stdout.
  
      'link' allows you to make hard links (os.link) or symbolic links
--- 90,94 ----
      last-access times are copied as well.  If 'update' is true, 'src' will
      only be copied if 'dst' does not exist, or if 'dst' does exist but is
!     older than 'src'.
  
      'link' allows you to make hard links (os.link) or symbolic links
***************
*** 128,134 ****
  
      if update and not newer(src, dst):
!         if verbose:
!             print "not copying %s (output up-to-date)" % src
!         return (dst, 0)
  
      try:
--- 126,131 ----
  
      if update and not newer(src, dst):
!         log.debug("not copying %s (output up-to-date)", src)
!         return dst, 0
  
      try:
***************
*** 137,145 ****
          raise ValueError, \
                "invalid value '%s' for 'link' argument" % link
!     if verbose:
!         if os.path.basename(dst) == os.path.basename(src):
!             print "%s %s -> %s" % (action, src, dir)
!         else:
!             print "%s %s -> %s" % (action, src, dst)
  
      if dry_run:
--- 134,141 ----
          raise ValueError, \
                "invalid value '%s' for 'link' argument" % link
!     if os.path.basename(dst) == os.path.basename(src):
!         log.info("%s %s -> %s", action, src, dir)
!     else:
!         log.info("%s %s -> %s", action, src, dst)
  
      if dry_run:
***************
*** 198,203 ****
      import errno
  
!     if verbose:
!         print "moving %s -> %s" % (src, dst)
  
      if dry_run:
--- 194,198 ----
      import errno
  
!     log.info("moving %s -> %s", src, dst)
  
      if dry_run:

Index: filelist.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/filelist.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** filelist.py	6 Dec 2001 20:51:35 -0000	1.9
--- filelist.py	4 Jun 2002 20:14:42 -0000	1.10
***************
*** 38,49 ****
                   warn=None,
                   debug_print=None):
!         # use standard warning and debug functions if no other given
!         self.warn = warn or self.__warn
!         self.debug_print = debug_print or self.__debug_print
  
          self.allfiles = None
          self.files = []
  
- 
      def set_allfiles (self, allfiles):
          self.allfiles = allfiles
--- 38,47 ----
                   warn=None,
                   debug_print=None):
!         # ignore argument to FileList, but keep them for backwards
!         # compatibility
  
          self.allfiles = None
          self.files = []
  
      def set_allfiles (self, allfiles):
          self.allfiles = allfiles
***************
*** 52,62 ****
          self.allfiles = findall(dir)
  
! 
!     # -- Fallback warning/debug functions ------------------------------
! 
!     def __warn (self, msg):
!         sys.stderr.write("warning: %s\n" % msg)
! 
!     def __debug_print (self, msg):
          """Print 'msg' to stdout if the global DEBUG (taken from the
          DISTUTILS_DEBUG environment variable) flag is true.
--- 50,54 ----
          self.allfiles = findall(dir)
  
!     def debug_print (self, msg):
          """Print 'msg' to stdout if the global DEBUG (taken from the
          DISTUTILS_DEBUG environment variable) flag is true.
***************
*** 66,70 ****
              print msg
  
- 
      # -- List-like methods ---------------------------------------------
  
--- 58,61 ----
***************
*** 88,93 ****
      def remove_duplicates (self):
          # Assumes list has been sorted!
!         for i in range(len(self.files)-1, 0, -1):
!             if self.files[i] == self.files[i-1]:
                  del self.files[i]
  
--- 79,84 ----
      def remove_duplicates (self):
          # Assumes list has been sorted!
!         for i in range(len(self.files) - 1, 0, -1):
!             if self.files[i] == self.files[i - 1]:
                  del self.files[i]
  
***************
*** 148,152 ****
              for pattern in patterns:
                  if not self.include_pattern(pattern, anchor=1):
!                     self.warn("no files found matching '%s'" % pattern)
  
          elif action == 'exclude':
--- 139,144 ----
              for pattern in patterns:
                  if not self.include_pattern(pattern, anchor=1):
!                     log.warn("warning: no files found matching '%s'",
!                              pattern)
  
          elif action == 'exclude':
***************
*** 154,160 ****
              for pattern in patterns:
                  if not self.exclude_pattern(pattern, anchor=1):
!                     self.warn(
!                         "no previously-included files found matching '%s'"%
!                         pattern)
  
          elif action == 'global-include':
--- 146,151 ----
              for pattern in patterns:
                  if not self.exclude_pattern(pattern, anchor=1):
!                     log.warn(("warning: no previously-included files "
!                               "found matching '%s'"), pattern)
  
          elif action == 'global-include':
***************
*** 162,168 ****
              for pattern in patterns:
                  if not self.include_pattern(pattern, anchor=0):
!                     self.warn(("no files found matching '%s' " +
!                                "anywhere in distribution") %
!                               pattern)
  
          elif action == 'global-exclude':
--- 153,158 ----
              for pattern in patterns:
                  if not self.include_pattern(pattern, anchor=0):
!                     log.warn(("warning: no files found matching '%s' " +
!                               "anywhere in distribution"), pattern)
  
          elif action == 'global-exclude':
***************
*** 170,176 ****
              for pattern in patterns:
                  if not self.exclude_pattern(pattern, anchor=0):
!                     self.warn(("no previously-included files matching '%s' " +
!                                "found anywhere in distribution") %
!                               pattern)
  
          elif action == 'recursive-include':
--- 160,166 ----
              for pattern in patterns:
                  if not self.exclude_pattern(pattern, anchor=0):
!                     log.warn(("warning: no previously-included files matching "
!                               "'%s' found anywhere in distribution"),
!                              pattern)
  
          elif action == 'recursive-include':
***************
*** 179,185 ****
              for pattern in patterns:
                  if not self.include_pattern(pattern, prefix=dir):
!                     self.warn(("no files found matching '%s' " +
!                                 "under directory '%s'") %
!                                (pattern, dir))
  
          elif action == 'recursive-exclude':
--- 169,175 ----
              for pattern in patterns:
                  if not self.include_pattern(pattern, prefix=dir):
!                     log.warn(("warngin: no files found matching '%s' " +
!                                 "under directory '%s'"), 
!                              pattern, dir)
  
          elif action == 'recursive-exclude':
***************
*** 188,206 ****
              for pattern in patterns:
                  if not self.exclude_pattern(pattern, prefix=dir):
!                     self.warn(("no previously-included files matching '%s' " +
!                                "found under directory '%s'") %
!                               (pattern, dir))
  
          elif action == 'graft':
              self.debug_print("graft " + dir_pattern)
              if not self.include_pattern(None, prefix=dir_pattern):
!                 self.warn("no directories found matching '%s'" % dir_pattern)
  
          elif action == 'prune':
              self.debug_print("prune " + dir_pattern)
              if not self.exclude_pattern(None, prefix=dir_pattern):
!                 self.warn(("no previously-included directories found " +
!                            "matching '%s'") %
!                           dir_pattern)
          else:
              raise DistutilsInternalError, \
--- 178,196 ----
              for pattern in patterns:
                  if not self.exclude_pattern(pattern, prefix=dir):
!                     log.warn(("warning: no previously-included files matching "
!                               "'%s' found under directory '%s'"),
!                              pattern, dir)
  
          elif action == 'graft':
              self.debug_print("graft " + dir_pattern)
              if not self.include_pattern(None, prefix=dir_pattern):
!                 log.warn("warning: no directories found matching '%s'",
!                          dir_pattern)
  
          elif action == 'prune':
              self.debug_print("prune " + dir_pattern)
              if not self.exclude_pattern(None, prefix=dir_pattern):
!                 log.warn(("no previously-included directories found " +
!                           "matching '%s'"), dir_pattern)
          else:
              raise DistutilsInternalError, \

Index: msvccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/msvccompiler.py,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** msvccompiler.py	25 Apr 2002 17:29:45 -0000	1.46
--- msvccompiler.py	4 Jun 2002 20:14:42 -0000	1.47
***************
*** 18,21 ****
--- 18,22 ----
  from distutils.ccompiler import \
       CCompiler, gen_preprocess_options, gen_lib_options
+ from distutils import log
  
  _can_read_reg = 0
***************
*** 306,310 ****
  
              if skip_sources[src]:
!                 self.announce ("skipping %s (%s up-to-date)" % (src, obj))
              else:
                  self.mkpath (os.path.dirname (obj))
--- 307,311 ----
  
              if skip_sources[src]:
!                 log.debug("skipping %s (%s up-to-date)", src, obj)
              else:
                  self.mkpath (os.path.dirname (obj))
***************
*** 404,408 ****
  
          else:
!             self.announce ("skipping %s (up-to-date)" % output_filename)
  
      # create_static_lib ()
--- 405,409 ----
  
          else:
!             log.debug("skipping %s (up-to-date)", output_filename)
  
      # create_static_lib ()
***************
*** 481,485 ****
  
          else:
!             self.announce ("skipping %s (up-to-date)" % output_filename)
  
      # link ()
--- 482,486 ----
  
          else:
!             log.debug("skipping %s (up-to-date)", output_filename)
  
      # link ()

Index: mwerkscompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/mwerkscompiler.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mwerkscompiler.py	6 Dec 2001 20:51:35 -0000	1.6
--- mwerkscompiler.py	4 Jun 2002 20:14:42 -0000	1.7
***************
*** 14,17 ****
--- 14,18 ----
  import distutils.util
  import distutils.dir_util
+ from distutils import log
  import mkcwproject
  
***************
*** 133,138 ****
          prefixname = 'mwerks_%s_config.h'%basename
          # Create the directories we need
!         distutils.dir_util.mkpath(build_temp, self.verbose, self.dry_run)
!         distutils.dir_util.mkpath(output_dir, self.verbose, self.dry_run)
          # And on to filling in the parameters for the project builder
          settings = {}
--- 134,139 ----
          prefixname = 'mwerks_%s_config.h'%basename
          # Create the directories we need
!         distutils.dir_util.mkpath(build_temp, dry_run=self.dry_run)
!         distutils.dir_util.mkpath(output_dir, dry_run=self.dry_run)
          # And on to filling in the parameters for the project builder
          settings = {}
***************
*** 160,165 ****
          # Build the export file
          exportfilename = os.path.join(build_temp, exportname)
!         if self.verbose:
!             print '\tCreate export file', exportfilename
          fp = open(exportfilename, 'w')
          fp.write('%s\n'%export_symbols[0])
--- 161,165 ----
          # Build the export file
          exportfilename = os.path.join(build_temp, exportname)
!         log.debug("\tCreate export file", exportfilename)
          fp = open(exportfilename, 'w')
          fp.write('%s\n'%export_symbols[0])
***************
*** 182,187 ****
          # doesn't have a clue about our working directory.
          xmlfilename = os.path.join(os.getcwd(), os.path.join(build_temp, xmlname))
!         if self.verbose:
!             print '\tCreate XML file', xmlfilename
          xmlbuilder = mkcwproject.cwxmlgen.ProjectBuilder(settings)
          xmlbuilder.generate()
--- 182,186 ----
          # doesn't have a clue about our working directory.
          xmlfilename = os.path.join(os.getcwd(), os.path.join(build_temp, xmlname))
!         log.debug("\tCreate XML file", xmlfilename)
          xmlbuilder = mkcwproject.cwxmlgen.ProjectBuilder(settings)
          xmlbuilder.generate()
***************
*** 192,201 ****
          # Generate the project. Again a full pathname.
          projectfilename = os.path.join(os.getcwd(), os.path.join(build_temp, projectname))
!         if self.verbose:
!             print '\tCreate project file', projectfilename
          mkcwproject.makeproject(xmlfilename, projectfilename)
          # And build it
!         if self.verbose:
!             print '\tBuild project'
          mkcwproject.buildproject(projectfilename)
  
--- 191,198 ----
          # Generate the project. Again a full pathname.
          projectfilename = os.path.join(os.getcwd(), os.path.join(build_temp, projectname))
!         log.debug('\tCreate project file', projectfilename)
          mkcwproject.makeproject(xmlfilename, projectfilename)
          # And build it
!         log.debug('\tBuild project')
          mkcwproject.buildproject(projectfilename)
  

Index: spawn.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/spawn.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** spawn.py	31 Jan 2002 18:55:32 -0000	1.12
--- spawn.py	4 Jun 2002 20:14:42 -0000	1.13
***************
*** 13,17 ****
  import sys, os, string
  from distutils.errors import *
! 
  
  def spawn (cmd,
--- 13,17 ----
  import sys, os, string
  from distutils.errors import *
! from distutils import log
  
  def spawn (cmd,
***************
*** 28,33 ****
      If 'search_path' is true (the default), the system's executable search
      path will be used to find the program; otherwise, cmd[0] must be the
!     exact path to the executable.  If 'verbose' is true, a one-line summary
!     of the command will be printed before it is run.  If 'dry_run' is true,
      the command will not actually be run.
  
--- 28,32 ----
      If 'search_path' is true (the default), the system's executable search
      path will be used to find the program; otherwise, cmd[0] must be the
!     exact path to the executable.If 'dry_run' is true,
      the command will not actually be run.
  
***************
*** 36,44 ****
      """
      if os.name == 'posix':
!         _spawn_posix(cmd, search_path, verbose, dry_run)
      elif os.name == 'nt':
!         _spawn_nt(cmd, search_path, verbose, dry_run)
      elif os.name == 'os2':
!         _spawn_os2(cmd, search_path, verbose, dry_run)
      else:
          raise DistutilsPlatformError, \
--- 35,43 ----
      """
      if os.name == 'posix':
!         _spawn_posix(cmd, search_path, dry_run=dry_run)
      elif os.name == 'nt':
!         _spawn_nt(cmd, search_path, dry_run=dry_run)
      elif os.name == 'os2':
!         _spawn_os2(cmd, search_path, dry_run=dry_run)
      else:
          raise DistutilsPlatformError, \
***************
*** 75,80 ****
          # either we find one or it stays the same
          executable = find_executable(executable) or executable
!     if verbose:
!         print string.join([executable] + cmd[1:], ' ')
      if not dry_run:
          # spawn for NT requires a full path to the .exe
--- 74,78 ----
          # either we find one or it stays the same
          executable = find_executable(executable) or executable
!     log.info(string.join([executable] + cmd[1:], ' '))
      if not dry_run:
          # spawn for NT requires a full path to the .exe
***************
*** 101,106 ****
          # either we find one or it stays the same
          executable = find_executable(executable) or executable 
!     if verbose:
!         print string.join([executable] + cmd[1:], ' ')
      if not dry_run:
          # spawnv for OS/2 EMX requires a full path to the .exe
--- 99,103 ----
          # either we find one or it stays the same
          executable = find_executable(executable) or executable 
!     log.info(string.join([executable] + cmd[1:], ' '))
      if not dry_run:
          # spawnv for OS/2 EMX requires a full path to the .exe
***************
*** 123,128 ****
                    dry_run=0):
  
!     if verbose:
!         print string.join(cmd, ' ')
      if dry_run:
          return
--- 120,124 ----
                    dry_run=0):
  
!     log.info(string.join(cmd, ' '))
      if dry_run:
          return

Index: unixccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/unixccompiler.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** unixccompiler.py	11 Feb 2002 15:31:50 -0000	1.39
--- unixccompiler.py	4 Jun 2002 20:14:42 -0000	1.40
***************
*** 27,30 ****
--- 27,31 ----
  from distutils.errors import \
       DistutilsExecError, CompileError, LibError, LinkError
+ from distutils import log
  
  # XXX Things not currently handled:
***************
*** 148,152 ****
              src = sources[i] ; obj = objects[i]
              if skip_sources[src]:
!                 self.announce("skipping %s (%s up-to-date)" % (src, obj))
              else:
                  self.mkpath(os.path.dirname(obj))
--- 149,153 ----
              src = sources[i] ; obj = objects[i]
              if skip_sources[src]:
!                 log.debug("skipping %s (%s up-to-date)", src, obj)
              else:
                  self.mkpath(os.path.dirname(obj))
***************
*** 192,196 ****
                      raise LibError, msg
          else:
!             self.announce("skipping %s (up-to-date)" % output_filename)
  
      # create_static_lib ()
--- 193,197 ----
                      raise LibError, msg
          else:
!             log.debug("skipping %s (up-to-date)", output_filename)
  
      # create_static_lib ()
***************
*** 241,245 ****
                  raise LinkError, msg
          else:
!             self.announce("skipping %s (up-to-date)" % output_filename)
  
      # link ()
--- 242,246 ----
                  raise LinkError, msg
          else:
!             log.debug("skipping %s (up-to-date)", output_filename)
  
      # link ()

Index: util.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/util.py,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** util.py	6 May 2002 13:57:19 -0000	1.67
--- util.py	4 Jun 2002 20:14:42 -0000	1.68
***************
*** 13,17 ****
  from distutils.dep_util import newer
  from distutils.spawn import spawn
! 
  
  def get_platform ():
--- 13,17 ----
  from distutils.dep_util import newer
  from distutils.spawn import spawn
! from distutils import log
  
  def get_platform ():
***************
*** 276,288 ****
  
  def execute (func, args, msg=None, verbose=0, dry_run=0):
!     """Perform some action that affects the outside world (eg.  by writing
!     to the filesystem).  Such actions are special because they are disabled
!     by the 'dry_run' flag, and announce themselves if 'verbose' is true.
!     This method takes care of all that bureaucracy for you; all you have to
!     do is supply the function to call and an argument tuple for it (to
!     embody the "external action" being performed), and an optional message
!     to print.
      """
-     # Generate a message if we weren't passed one
      if msg is None:
          msg = "%s%s" % (func.__name__, `args`)
--- 276,287 ----
  
  def execute (func, args, msg=None, verbose=0, dry_run=0):
!     """Perform some action that affects the outside world (eg.  by
!     writing to the filesystem).  Such actions are special because they
!     are disabled by the 'dry_run' flag.  This method takes care of all
!     that bureaucracy for you; all you have to do is supply the
!     function to call and an argument tuple for it (to embody the
!     "external action" being performed), and an optional message to
!     print.
      """
      if msg is None:
          msg = "%s%s" % (func.__name__, `args`)
***************
*** 290,306 ****
              msg = msg[0:-2] + ')'
  
!     # Print it if verbosity level is high enough
!     if verbose:
!         print msg
! 
!     # And do it, as long as we're not in dry-run mode
      if not dry_run:
          apply(func, args)
  
- # execute()
- 
  
  def strtobool (val):
      """Convert a string representation of truth to true (1) or false (0).
      True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
      are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
--- 289,300 ----
              msg = msg[0:-2] + ')'
  
!     log.info(msg)
      if not dry_run:
          apply(func, args)
  
  
  def strtobool (val):
      """Convert a string representation of truth to true (1) or false (0).
+     
      True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
      are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
***************
*** 338,343 ****
      (or neither) of 'prefix' and 'base_dir', as you wish.
  
!     If 'verbose' is true, prints out a report of each file.  If 'dry_run'
!     is true, doesn't actually do anything that would affect the filesystem.
  
      Byte-compilation is either done directly in this interpreter process
--- 332,337 ----
      (or neither) of 'prefix' and 'base_dir', as you wish.
  
!     If 'dry_run' is true, doesn't actually do anything that would
!     affect the filesystem.
  
      Byte-compilation is either done directly in this interpreter process
***************
*** 368,373 ****
          from tempfile import mktemp
          script_name = mktemp(".py")
!         if verbose:
!             print "writing byte-compilation script '%s'" % script_name
          if not dry_run:
              script = open(script_name, "w")
--- 362,366 ----
          from tempfile import mktemp
          script_name = mktemp(".py")
!         log.info("writing byte-compilation script '%s'", script_name)
          if not dry_run:
              script = open(script_name, "w")
***************
*** 407,413 ****
          elif optimize == 2:
              cmd.insert(1, "-OO")
!         spawn(cmd, verbose=verbose, dry_run=dry_run)
          execute(os.remove, (script_name,), "removing %s" % script_name,
!                 verbose=verbose, dry_run=dry_run)
  
      # "Direct" byte-compilation: use the py_compile module to compile
--- 400,406 ----
          elif optimize == 2:
              cmd.insert(1, "-OO")
!         spawn(cmd, dry_run=dry_run)
          execute(os.remove, (script_name,), "removing %s" % script_name,
!                 dry_run=dry_run)
  
      # "Direct" byte-compilation: use the py_compile module to compile
***************
*** 441,452 ****
              if direct:
                  if force or newer(file, cfile):
!                     if verbose:
!                         print "byte-compiling %s to %s" % (file, cfile_base)
                      if not dry_run:
                          compile(file, cfile, dfile)
                  else:
!                     if verbose:
!                         print "skipping byte-compilation of %s to %s" % \
!                               (file, cfile_base)
  
  # byte_compile ()
--- 434,443 ----
              if direct:
                  if force or newer(file, cfile):
!                     log.info("byte-compiling %s to %s", file, cfile_base)
                      if not dry_run:
                          compile(file, cfile, dfile)
                  else:
!                     log.debug("skipping byte-compilation of %s to %s",
!                               file, cfile_base)
  
  # byte_compile ()