[Python-checkins] CVS: python/dist/src/Lib dospath.py,1.14,1.15

Skip Montanaro python-dev@python.org
2000年7月16日 20:04:22 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv9608
Modified Files:
	dospath.py 
Log Message:
* split on / or \
* case insensitive
Index: dospath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dospath.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** dospath.py	2000年07月12日 16:55:57	1.14
--- dospath.py	2000年07月17日 03:04:19	1.15
***************
*** 108,117 ****
 "Given a list of pathnames, returns the longest common leading component"
 if not m: return ''
! n = m[:]
 for i in range(len(n)):
! n[i] = n[i].split(os.sep)
! # if os.sep didn't have any effect, try os.altsep
! if os.altsep and len(n[i]) == 1:
! n[i] = n[i].split(os.altsep)
 
 prefix = n[0]
--- 108,114 ----
 "Given a list of pathnames, returns the longest common leading component"
 if not m: return ''
! n = map(string.lower, m)
 for i in range(len(n)):
! n[i] = re.split(r"[/\\]", n[i])
 
 prefix = n[0]
***************
*** 122,126 ****
 if i == 0: return ''
 break
! return os.sep.join(prefix)
 
 
--- 119,123 ----
 if i == 0: return ''
 break
! return "\\".join(prefix)
 
 

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