[Python-checkins] CVS: distutils/distutils cmd.py,1.13,1.14

Greg Ward python-dev@python.org
Sun, 28 May 2000 16:54:02 -0700


Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv10660

Modified Files:
	cmd.py 
Log Message:
Added 'dump_options()' for debugging output.

Index: cmd.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/cmd.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** cmd.py	2000/05/27 17:27:22	1.13
--- cmd.py	2000/05/28 23:54:00	1.14
***************
*** 7,11 ****
  # (extricated from core.py; actually dates back to the beginning)
  
! __revision__ = "$Id: cmd.py,v 1.13 2000/05/27 17:27:22 gward Exp $"
  
  import sys, os, string
--- 7,11 ----
  # (extricated from core.py; actually dates back to the beginning)
  
! __revision__ = "$Id: cmd.py,v 1.14 2000/05/28 23:54:00 gward Exp $"
  
  import sys, os, string
***************
*** 135,138 ****
--- 135,153 ----
          raise RuntimeError, \
                "abstract method -- subclass %s must override" % self.__class__
+ 
+ 
+     def dump_options (self, header=None, indent=""):
+         from distutils.fancy_getopt import longopt_xlate
+         if header is None:
+             header = "command options for '%s':" % self.get_command_name()
+         print indent + header
+         indent = indent + "  "
+         for (option, _, _) in self.user_options:
+             option = string.translate(option, longopt_xlate)
+             if option[-1] == "=":
+                 option = option[:-1]
+             value = getattr(self, option)
+             print indent + "%s = %s" % (option, value)
+ 
  
      def run (self):