pep8-fied

This commit is contained in:
Tarek Ziadé 2009-04-13 20:14:54 +00:00
parent 2fdd0d5ab7
commit eb6e0f583d

View file

@ -93,11 +93,7 @@ class Command:
# always calls 'finalize_options()', to respect/update it.
self.finalized = 0
# __init__ ()
# XXX A more explicit way to customize dry_run would be better.
def __getattr__(self, attr):
if attr == 'dry_run':
myval = getattr(self, "_" + attr)
@ -108,13 +104,11 @@ class Command:
else:
raise AttributeError, attr
def ensure_finalized(self):
if not self.finalized:
self.finalize_options()
self.finalized = 1
# Subclasses must define:
# initialize_options()
# provide default values for all options; may be customized by
@ -180,7 +174,6 @@ class Command:
This method must be implemented by all command classes.
"""
raise RuntimeError, \
"abstract method -- subclass %s must override" % self.__class__
@ -200,7 +193,6 @@ class Command:
sys.stdout.flush()
# -- Option validation methods -------------------------------------
# (these are very handy in writing the 'finalize_options()' method)
#
@ -285,7 +277,6 @@ class Command:
else:
return self.__class__.__name__
def set_undefined_options(self, src_cmd, *option_pairs):
"""Set the values of any "undefined" options from corresponding
option values in some other command object. "Undefined" here means
@ -334,7 +325,6 @@ class Command:
"""
self.distribution.run_command(command)
def get_sub_commands(self):
"""Determine the sub-commands that are relevant in the current
distribution (ie., that need to be run). This is based on the
@ -358,11 +348,9 @@ class Command:
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)
def copy_file(self, infile, outfile,
preserve_mode=1, preserve_times=1, link=None, level=1):
"""Copy a file respecting verbose, dry-run and force flags. (The
@ -376,7 +364,6 @@ class Command:
link,
dry_run=self.dry_run)
def copy_tree(self, infile, outfile,
preserve_mode=1, preserve_times=1, preserve_symlinks=0,
level=1):
@ -403,7 +390,6 @@ class Command:
return archive_util.make_archive(
base_name, format, root_dir, base_dir, dry_run=self.dry_run)
def make_file(self, infiles, outfile, func, args,
exec_msg=None, skip_msg=None, level=1):
"""Special case of 'execute()' for operations that process one or
@ -438,11 +424,6 @@ class Command:
else:
log.debug(skip_msg)
# make_file ()
# class Command
# XXX 'install_misc' class not currently used -- it was the base class for
# both 'install_scripts' and 'install_data', but they outgrew it. It might
# still be useful for 'install_headers', though, so I'm keeping it around