[Python-checkins] CVS: distutils/distutils fancy_getopt.py,1.11,1.12

Greg Ward python-dev@python.org
Mon, 22 May 2000 18:44:22 -0700


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

Modified Files:
	fancy_getopt.py 
Log Message:
OptionDummy now has a constructor that takes a list of options: each string
in the option list is an attribute of the OptionDummy that will be
initialized to None.

Index: fancy_getopt.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/fancy_getopt.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** fancy_getopt.py	2000/04/23 02:50:45	1.11
--- fancy_getopt.py	2000/05/23 01:44:20	1.12
***************
*** 11,15 ****
  # created 1999/03/03, Greg Ward
  
! __revision__ = "$Id: fancy_getopt.py,v 1.11 2000/04/23 02:50:45 gward Exp $"
  
  import sys, string, re
--- 11,15 ----
  # created 1999/03/03, Greg Ward
  
! __revision__ = "$Id: fancy_getopt.py,v 1.12 2000/05/23 01:44:20 gward Exp $"
  
  import sys, string, re
***************
*** 240,244 ****
              args = sys.argv[1:]
          if object is None:
!             object = OptionDummy()
              created_object = 1
          else:
--- 240,244 ----
              args = sys.argv[1:]
          if object is None:
!             object = OptionDummy(self.attr_name.values())
              created_object = 1
          else:
***************
*** 466,470 ****
      """Dummy class just used as a place to hold command-line option
      values as instance attributes."""
!     pass
      
  
--- 466,477 ----
      """Dummy class just used as a place to hold command-line option
      values as instance attributes."""
! 
!     def __init__ (self, options=[]):
!         """Create a new OptionDummy instance.  The attributes listed in
!         'options' will be initialized to None."""
!         for opt in options:
!             setattr(self, opt, None)
! 
! # class OptionDummy