[Python-checkins] CVS: distutils/distutils filelist.py,1.3,1.4

Greg Ward python-dev@python.org
Sat, 29 Jul 2000 17:36:27 -0700


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

Modified Files:
	filelist.py 
Log Message:
Renamed 'select_pattern()' to 'include_pattern()'.
Other cosmetic/doc/comment tweaks.

Index: filelist.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/filelist.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** filelist.py	2000/07/30 00:21:36	1.3
--- filelist.py	2000/07/30 00:36:25	1.4
***************
*** 106,110 ****
  
          # Parse the line: split it up, make sure the right number of words
!         # are there, and return the relevant words.  'action' is always
          # defined: it's the first word of the line.  Which of the other
          # three are defined depends on the action; it'll be either
--- 106,110 ----
  
          # Parse the line: split it up, make sure the right number of words
!         # is there, and return the relevant words.  'action' is always
          # defined: it's the first word of the line.  Which of the other
          # three are defined depends on the action; it'll be either
***************
*** 118,122 ****
              self.debug_print("include " + string.join(patterns))
              for pattern in patterns:
!                 if not self.select_pattern (pattern, anchor=1):
                      self.warn("no files found matching '%s'" % pattern)
  
--- 118,122 ----
              self.debug_print("include " + string.join(patterns))
              for pattern in patterns:
!                 if not self.include_pattern (pattern, anchor=1):
                      self.warn("no files found matching '%s'" % pattern)
  
***************
*** 132,136 ****
              self.debug_print("global-include " + string.join(patterns))
              for pattern in patterns:
!                 if not self.select_pattern (pattern, anchor=0):
                      self.warn (("no files found matching '%s' " +
                                  "anywhere in distribution") %
--- 132,136 ----
              self.debug_print("global-include " + string.join(patterns))
              for pattern in patterns:
!                 if not self.include_pattern (pattern, anchor=0):
                      self.warn (("no files found matching '%s' " +
                                  "anywhere in distribution") %
***************
*** 149,153 ****
                               (dir, string.join(patterns)))
              for pattern in patterns:
!                 if not self.select_pattern (pattern, prefix=dir):
                      self.warn (("no files found matching '%s' " +
                                  "under directory '%s'") %
--- 149,153 ----
                               (dir, string.join(patterns)))
              for pattern in patterns:
!                 if not self.include_pattern (pattern, prefix=dir):
                      self.warn (("no files found matching '%s' " +
                                  "under directory '%s'") %
***************
*** 165,169 ****
          elif action == 'graft':
              self.debug_print("graft " + dir_pattern)
!             if not self.select_pattern(None, prefix=dir_pattern):
                  self.warn ("no directories found matching '%s'" % dir_pattern)
  
--- 165,169 ----
          elif action == 'graft':
              self.debug_print("graft " + dir_pattern)
!             if not self.include_pattern(None, prefix=dir_pattern):
                  self.warn ("no directories found matching '%s'" % dir_pattern)
  
***************
*** 181,193 ****
  
  
!     def select_pattern (self, pattern,
                          anchor=1, prefix=None, is_regex=0):
-         """Select strings (presumably filenames) from 'files' that match
-         'pattern', a Unix-style wildcard (glob) pattern.  Patterns are not
-         quite the same as implemented by the 'fnmatch' module: '*' and '?'
-         match non-special characters, where "special" is platform-dependent:
-         slash on Unix, colon, slash, and backslash on DOS/Windows, and colon on
-         Mac OS.
  
          If 'anchor' is true (the default), then the pattern match is more
          stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
--- 181,194 ----
  
  
!     def include_pattern (self, pattern,
                          anchor=1, prefix=None, is_regex=0):
  
+         """Select strings (presumably filenames) from 'self.files' that
+         match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
+         are not quite the same as implemented by the 'fnmatch' module: '*'
+         and '?'  match non-special characters, where "special" is platform-
+         dependent: slash on Unix; colon, slash, and backslash on
+         DOS/Windows; and colon on Mac OS.
+ 
          If 'anchor' is true (the default), then the pattern match is more
          stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
***************
*** 209,213 ****
          files_found = 0
          pattern_re = translate_pattern (pattern, anchor, prefix, is_regex)
!         self.debug_print("select_pattern: applying regex r'%s'" %
                           pattern_re.pattern)
  
--- 210,214 ----
          files_found = 0
          pattern_re = translate_pattern (pattern, anchor, prefix, is_regex)
!         self.debug_print("include_pattern: applying regex r'%s'" %
                           pattern_re.pattern)
  
***************
*** 223,227 ****
          return files_found
  
!     # select_pattern ()
  
  
--- 224,228 ----
          return files_found
  
!     # include_pattern ()
  
  
***************
*** 230,234 ****
          """Remove strings (presumably filenames) from 'files' that match
          'pattern'.  Other parameters are the same as for
!         'select_pattern()', above.  
          The list 'self.files' is modified in place.
          Return 1 if files are found.
--- 231,235 ----
          """Remove strings (presumably filenames) from 'files' that match
          'pattern'.  Other parameters are the same as for
!         'include_pattern()', above.  
          The list 'self.files' is modified in place.
          Return 1 if files are found.