summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-03-31 03:05:18 (GMT)
committerGreg Ward <gward@python.net>2000-03-31 03:05:18 (GMT)
commit1b64a7e4a54b41ab2ebfb942bb5bc2c04deb16f9 (patch)
tree6b898e53d6c5c323705e861fd5987203c09508f7
parent32ce329ce4c8ac8a958a624f060274bd50a8f5b9 (diff)
downloadcpython-1b64a7e4a54b41ab2ebfb942bb5bc2c04deb16f9.zip
cpython-1b64a7e4a54b41ab2ebfb942bb5bc2c04deb16f9.tar.gz
cpython-1b64a7e4a54b41ab2ebfb942bb5bc2c04deb16f9.tar.bz2
Added 'get_name()' and 'get_full_name()' methods to Distribution.
Simplified 'Command.get_peer_option()' a tad -- just call 'find_peer()' to get the peer command object. Updated 'Command.copy_file()' to take a 'link' parameter, just like 'util.copy_file()' does now. Added 'Command.make_archive()' to wrap 'util.make_archive()'.
-rw-r--r--Lib/distutils/core.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py
index 08a1d64..025e1c0 100644
--- a/Lib/distutils/core.py
+++ b/Lib/distutils/core.py
@@ -638,6 +638,13 @@ class Distribution:
not self.has_ext_modules() and
not self.has_c_libraries())
+ def get_name (self):
+ return self.name or "UNKNOWN"
+
+ def get_full_name (self):
+ return "%s-%s" % ((self.name or "UNKNOWN"), (self.version or "???"))
+
+
# class Distribution
@@ -887,7 +894,7 @@ class Command:
"""Find or create the command object for 'command', and return
its 'option' option."""
- cmd_obj = self.distribution.find_command_obj (command)
+ cmd_obj = self.find_peer (command)
return cmd_obj.get_option (option)
@@ -939,12 +946,13 @@ class Command:
def copy_file (self, infile, outfile,
- preserve_mode=1, preserve_times=1, level=1):
+ preserve_mode=1, preserve_times=1, link=None, level=1):
"""Copy a file respecting verbose, dry-run and force flags."""
return util.copy_file (infile, outfile,
preserve_mode, preserve_times,
not self.force,
+ link,
self.verbose >= level,
self.dry_run)
@@ -976,6 +984,12 @@ class Command:
self.dry_run)
+ def make_archive (self, base_name, format,
+ root_dir=None, base_dir=None):
+ util.make_archive (base_name, format, root_dir, base_dir,
+ self.verbose, self.dry_run)
+
+
def make_file (self, infiles, outfile, func, args,
exec_msg=None, skip_msg=None, level=1):