diff options
author | Greg Ward <gward@python.net> | 2000-08-02 01:37:53 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-08-02 01:37:53 (GMT) |
commit | d7faa81616c4205f48b16fc44220fc167d12e9c0 (patch) | |
tree | d57eae312c9249181dabcfb2acebd375a0f061aa /Lib | |
parent | 1c16ac360a3fc63bfb1008c3a935907fe9064f26 (diff) | |
download | cpython-d7faa81616c4205f48b16fc44220fc167d12e9c0.zip cpython-d7faa81616c4205f48b16fc44220fc167d12e9c0.tar.gz cpython-d7faa81616c4205f48b16fc44220fc167d12e9c0.tar.bz2 |
Replaced 'execute()' method with a thin wrapper around 'util.execute()'.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/cmd.py | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py index 8beb5d4..c905ede 100644 --- a/Lib/distutils/cmd.py +++ b/Lib/distutils/cmd.py @@ -318,31 +318,7 @@ class Command: def execute (self, func, args, msg=None, level=1): - """Perform some action that affects the outside world (eg. by - writing to the filesystem). Such actions are special because they - should be disabled by the "dry run" flag, and should announce - themselves if the current verbosity level is high enough. 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), a message to print - if the verbosity level is high enough, and an optional verbosity - threshold. - """ - - # Generate a message if we weren't passed one - if msg is None: - msg = "%s %s" % (func.__name__, `args`) - if msg[-2:] == ',)': # correct for singleton tuple - msg = msg[0:-2] + ')' - - # Print it if verbosity level is high enough - self.announce (msg, level) - - # And do it, as long as we're not in dry-run mode - if not self.dry_run: - apply (func, args) - - # execute() + util.execute(func, args, msg, self.verbose >= level, self.dry_run) def mkpath (self, name, mode=0777): |