[Python-checkins] CVS: distutils/distutils dir_util.py,1.4,1.5

Greg Ward python-dev@python.org
2000年6月16日 19:19:32 -0700


Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv28030
Modified Files:
	dir_util.py 
Log Message:
Renamed PATH_CREATED to _path_created, on the grounds that it's private and
mutable, rather than public and constant.
Index: dir_util.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/dir_util.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** dir_util.py	2000年06月17日 02:18:19	1.4
--- dir_util.py	2000年06月17日 02:19:30	1.5
***************
*** 14,18 ****
 # cache for by mkpath() -- in addition to cheapening redundant calls,
 # eliminates redundant "creating /foo/bar/baz" messages in dry-run mode
! PATH_CREATED = {}
 
 # I don't use os.makedirs because a) it's new to Python 1.5.2, and
--- 14,18 ----
 # cache for by mkpath() -- in addition to cheapening redundant calls,
 # eliminates redundant "creating /foo/bar/baz" messages in dry-run mode
! _path_created = {}
 
 # I don't use os.makedirs because a) it's new to Python 1.5.2, and
***************
*** 29,33 ****
 actually created."""
 
! global PATH_CREATED
 
 # Detect a common bug -- name is None
--- 29,33 ----
 actually created."""
 
! global _path_created
 
 # Detect a common bug -- name is None
***************
*** 45,49 ****
 if os.path.isdir (name) or name == '':
 return created_dirs
! if PATH_CREATED.get (name):
 return created_dirs
 
--- 45,49 ----
 if os.path.isdir (name) or name == '':
 return created_dirs
! if _path_created.get (name):
 return created_dirs
 
***************
*** 65,69 ****
 #print "head = %s, d = %s: " % (head, d),
 head = os.path.join (head, d)
! if PATH_CREATED.get (head):
 continue
 
--- 65,69 ----
 #print "head = %s, d = %s: " % (head, d),
 head = os.path.join (head, d)
! if _path_created.get (head):
 continue
 
***************
*** 79,83 ****
 "could not create '%s': %s" % (head, exc[-1])
 
! PATH_CREATED[head] = 1
 return created_dirs
 
--- 79,83 ----
 "could not create '%s': %s" % (head, exc[-1])
 
! _path_created[head] = 1
 return created_dirs
 
***************
*** 197,201 ****
 """
 from distutils.util import grok_environment_error
! global PATH_CREATED
 
 if verbose:
--- 197,201 ----
 """
 from distutils.util import grok_environment_error
! global _path_created
 
 if verbose:
***************
*** 209,214 ****
 apply(cmd[0], (cmd[1],))
 # remove dir from cache if it's already there
! if PATH_CREATED.has_key(cmd[1]):
! del PATH_CREATED[cmd[1]]
 except (IOError, OSError), exc:
 if verbose:
--- 209,214 ----
 apply(cmd[0], (cmd[1],))
 # remove dir from cache if it's already there
! if _path_created.has_key(cmd[1]):
! del _path_created[cmd[1]]
 except (IOError, OSError), exc:
 if verbose:

AltStyle によって変換されたページ (->オリジナル) /