[Python-checkins] CVS: distutils/distutils util.py,1.33,1.34

Greg Ward python-dev@python.org
2000年5月30日 19:32:12 -0700


Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv22163
Modified Files:
	util.py 
Log Message:
Renamed 'native_path()' to 'convert_path()'.
Also changed it so it doesn't barf if the path is already in native format
 (ie. contains os.sep).
Index: util.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/util.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** util.py	2000年05月31日 02:14:32	1.33
--- util.py	2000年05月31日 02:32:10	1.34
***************
*** 6,10 ****
 # created 1999年03月08日, Greg Ward
 
! __revision__ = "$Id: util.py,v 1.33 2000年05月31日 02:14:32 gward Exp $"
 
 import sys, os, string, re, shutil
--- 6,10 ----
 # created 1999年03月08日, Greg Ward
 
! __revision__ = "$Id: util.py,v 1.34 2000年05月31日 02:32:10 gward Exp $"
 
 import sys, os, string, re, shutil
***************
*** 59,63 ****
 
 
! def native_path (pathname):
 """Return 'pathname' as a name that will work on the native
 filesystem, i.e. split it on '/' and put it back together again
--- 59,63 ----
 
 
! def convert_path (pathname):
 """Return 'pathname' as a name that will work on the native
 filesystem, i.e. split it on '/' and put it back together again
***************
*** 74,87 ****
 raise ValueError, "path '%s' cannot end with '/'" % pathname
 if os.sep != '/':
! if os.sep in pathname:
! raise ValueError, \
! "path '%s' cannot contain '%c' character" % (pathname, os.sep)
! else:
! paths = string.split (pathname, '/')
! return apply (os.path.join, paths)
 else:
 return pathname
 
! # native_path ()
 
 
--- 74,83 ----
 raise ValueError, "path '%s' cannot end with '/'" % pathname
 if os.sep != '/':
! paths = string.split (pathname, '/')
! return apply (os.path.join, paths)
 else:
 return pathname
 
! # convert_path ()
 
 

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