[Python-checkins] CVS: distutils/distutils cmd.py,1.24,1.25
Greg Ward
python-dev@python.org
Mon, 25 Sep 2000 19:12:34 -0700
Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv1311
Modified Files:
cmd.py
Log Message:
Standardize whitespace in function calls.
Index: cmd.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/cmd.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** cmd.py 2000/09/16 15:25:55 1.24
--- cmd.py 2000/09/26 02:12:31 1.25
***************
*** 60,64 ****
from distutils.dist import Distribution
! if not isinstance (dist, Distribution):
raise TypeError, "dist must be a Distribution instance"
if self.__class__ is Command:
--- 60,64 ----
from distutils.dist import Distribution
! if not isinstance(dist, Distribution):
raise TypeError, "dist must be a Distribution instance"
if self.__class__ is Command:
***************
*** 66,70 ****
self.distribution = dist
! self.initialize_options ()
# Per-command versions of the global flags, so that the user can
--- 66,70 ----
self.distribution = dist
! self.initialize_options()
# Per-command versions of the global flags, so that the user can
***************
*** 99,105 ****
def __getattr__ (self, attr):
if attr in ('verbose', 'dry_run'):
! myval = getattr (self, "_" + attr)
if myval is None:
! return getattr (self.distribution, attr)
else:
return myval
--- 99,105 ----
def __getattr__ (self, attr):
if attr in ('verbose', 'dry_run'):
! myval = getattr(self, "_" + attr)
if myval is None:
! return getattr(self.distribution, attr)
else:
return myval
***************
*** 110,114 ****
def ensure_finalized (self):
if not self.finalized:
! self.finalize_options ()
self.finalized = 1
--- 110,114 ----
def ensure_finalized (self):
if not self.finalized:
! self.finalize_options()
self.finalized = 1
***************
*** 274,278 ****
def get_command_name (self):
! if hasattr (self, 'command_name'):
return self.command_name
else:
--- 274,278 ----
def get_command_name (self):
! if hasattr(self, 'command_name'):
return self.command_name
else:
***************
*** 297,306 ****
# Option_pairs: list of (src_option, dst_option) tuples
! src_cmd_obj = self.distribution.get_command_obj (src_cmd)
! src_cmd_obj.ensure_finalized ()
for (src_option, dst_option) in option_pairs:
! if getattr (self, dst_option) is None:
! setattr (self, dst_option,
! getattr (src_cmd_obj, src_option))
--- 297,306 ----
# Option_pairs: list of (src_option, dst_option) tuples
! src_cmd_obj = self.distribution.get_command_obj(src_cmd)
! src_cmd_obj.ensure_finalized()
for (src_option, dst_option) in option_pairs:
! if getattr(self, dst_option) is None:
! setattr(self, dst_option,
! getattr(src_cmd_obj, src_option))
***************
*** 311,316 ****
finalized command object.
"""
! cmd_obj = self.distribution.get_command_obj (command, create)
! cmd_obj.ensure_finalized ()
return cmd_obj
--- 311,316 ----
finalized command object.
"""
! cmd_obj = self.distribution.get_command_obj(command, create)
! cmd_obj.ensure_finalized()
return cmd_obj
***************
*** 326,330 ****
necessary and then invokes its 'run()' method.
"""
! self.distribution.run_command (command)
--- 326,330 ----
necessary and then invokes its 'run()' method.
"""
! self.distribution.run_command(command)
***************
*** 346,351 ****
def warn (self, msg):
! sys.stderr.write ("warning: %s: %s\n" %
! (self.get_command_name(), msg))
--- 346,351 ----
def warn (self, msg):
! sys.stderr.write("warning: %s: %s\n" %
! (self.get_command_name(), msg))
***************
*** 390,396 ****
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)
--- 390,396 ----
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)
***************
*** 398,404 ****
"""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)
--- 398,404 ----
"""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)
***************
*** 422,426 ****
if exec_msg is None:
exec_msg = "generating %s from %s" % \
! (outfile, string.join (infiles, ', '))
if skip_msg is None:
skip_msg = "skipping %s (inputs unchanged)" % outfile
--- 422,426 ----
if exec_msg is None:
exec_msg = "generating %s from %s" % \
! (outfile, string.join(infiles, ', '))
if skip_msg is None:
skip_msg = "skipping %s (inputs unchanged)" % outfile
***************
*** 428,434 ****
# Allow 'infiles' to be a single string
! if type (infiles) is StringType:
infiles = (infiles,)
! elif type (infiles) not in (ListType, TupleType):
raise TypeError, \
"'infiles' must be a string, or a list or tuple of strings"
--- 428,434 ----
# Allow 'infiles' to be a single string
! if type(infiles) is StringType:
infiles = (infiles,)
! elif type(infiles) not in (ListType, TupleType):
raise TypeError, \
"'infiles' must be a string, or a list or tuple of strings"
***************
*** 438,446 ****
# perform the action that presumably regenerates it
if self.force or dep_util.newer_group (infiles, outfile):
! self.execute (func, args, exec_msg, level)
# Otherwise, print the "skip" message
else:
! self.announce (skip_msg, level)
# make_file ()
--- 438,446 ----
# perform the action that presumably regenerates it
if self.force or dep_util.newer_group (infiles, outfile):
! self.execute(func, args, exec_msg, level)
# Otherwise, print the "skip" message
else:
! self.announce(skip_msg, level)
# make_file ()