diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-04-17 08:48:32 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-04-17 08:48:32 (GMT) |
commit | 9d72bb452bced3a100f07f8a9e30c4495a9ec41a (patch) | |
tree | c39762a764fcc16f2cfc42e2504e58ff31e159e6 /Lib/plat-riscos | |
parent | ff11334927ee616d765b54a3851016b76a20bcec (diff) | |
download | cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.zip cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.tar.gz cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.tar.bz2 |
Remove functions in string module that are also string methods. Also remove:
* all calls to functions in the string module (except maketrans)
* everything from stropmodule except for maketrans() which is still used
Diffstat (limited to 'Lib/plat-riscos')
-rw-r--r-- | Lib/plat-riscos/riscospath.py | 16 | ||||
-rw-r--r-- | Lib/plat-riscos/rourl2path.py | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/Lib/plat-riscos/riscospath.py b/Lib/plat-riscos/riscospath.py index ea39e60..af89eb3 100644 --- a/Lib/plat-riscos/riscospath.py +++ b/Lib/plat-riscos/riscospath.py @@ -59,13 +59,13 @@ def _split(p): """ dash= _allowMOSFSNames and p[:1]=='-' if dash: - q= string.find(p, '-', 1)+1 + q= p.find('-', 1)+1 else: if p[:1]==':': q= 0 else: - q= string.find(p, ':')+1 # q= index of start of non-FS portion of path - s= string.find(p, '#') + q= p.find(':')+1 # q= index of start of non-FS portion of path + s= p.find('#') if s==-1 or s>q: s= q # find end of main FS name, not including special field else: @@ -75,7 +75,7 @@ def _split(p): break # disallow invalid non-special-field characters in FS name r= q if p[q:q+1]==':': - r= string.find(p, '.', q+1)+1 + r= p.find('.', q+1)+1 if r==0: r= len(p) # find end of drive name (if any) following FS name (if any) return (p[:q], p[q:r], p[r:]) @@ -87,7 +87,7 @@ def normcase(p): OS filesystems are case-insensitive. However, not all filesystems have to be, and there's no simple way to find out what type an FS is argh. """ - return string.lower(p) + return p.lower() def isabs(p): @@ -126,7 +126,7 @@ def split(p): name must still be dealt with separately since special field may contain '.'. """ (fs, drive, path)= _split(p) - q= string.rfind(path, '.') + q= path.rfind('.') if q!=-1: return (fs+drive+path[:q], path[q+1:]) return ('', p) @@ -139,7 +139,7 @@ def splitext(p): """ (tail, head)= split(p) if '/' in head: - q= len(head)-string.rfind(head, '/') + q= len(head)-head.rfind('/') return (p[:-q], p[-q:]) return (p, '') @@ -291,7 +291,7 @@ def expanduser(p): fsname= fs[1:-1] else: fsname= fs[:-1] - fsname= string.split(fsname, '#', 1)[0] # remove special field from fs + fsname= fsname.split('#', 1)[0] # remove special field from fs x= swi.swi('OS_FSControl', 'ib2s.i;.....i', 54, b, fsname, l) if x<l: urd= b.tostring(0, l-x-1) diff --git a/Lib/plat-riscos/rourl2path.py b/Lib/plat-riscos/rourl2path.py index a5aee34..7694f1c 100644 --- a/Lib/plat-riscos/rourl2path.py +++ b/Lib/plat-riscos/rourl2path.py @@ -21,7 +21,7 @@ def url2pathname(url): url = url[2:] elif url[:2] == '//': raise RuntimeError, 'Cannot convert non-local URL to pathname' - components = string.split(url, '/') + components = url.split('/') if not components[0]: if '$' in components: del components[0] |