]> granicus.if.org Git - python/commitdiff
Added 'get_name()' and 'get_full_name()' methods to Distribution.
authorGreg Ward <gward@python.net>
Fri, 31 Mar 2000 03:05:18 +0000 (03:05 +0000)
committerGreg Ward <gward@python.net>
Fri, 31 Mar 2000 03:05:18 +0000 (03:05 +0000)
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()'.

Lib/distutils/core.py

index 08a1d641d1843bb9d268c7aa65d6df6dee322390..025e1c0df509786bf39176306ec68010087a2371 100644 (file)
@@ -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):