Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbe0a8e

Browse files
committed
macpath.cat --> join
1 parent 0b74480 commit fbe0a8e

4 files changed

Lines changed: 15 additions & 12 deletions

File tree

Lib/lib-old/packmail.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def pack(outfp, file, name):
2121
def packsome(outfp, dirname, names):
2222
for name in names:
2323
print name
24-
file = macpath.cat(dirname, name)
24+
file = macpath.join(dirname, name)
2525
pack(outfp, file, name)
2626

2727
# Pack all files from a directory
@@ -33,13 +33,13 @@ def packall(outfp, dirname):
3333
# Pack all files from a directory that are not older than a give one
3434
def packnotolder(outfp, dirname, oldest):
3535
names = mac.listdir(dirname)
36-
oldest = macpath.cat(dirname, oldest)
36+
oldest = macpath.join(dirname, oldest)
3737
st = mac.stat(oldest)
3838
mtime = st[ST_MTIME]
3939
todo = []
4040
for name in names:
4141
print name, '...',
42-
st = mac.stat(macpath.cat(dirname, name))
42+
st = mac.stat(macpath.join(dirname, name))
4343
if st[ST_MTIME] >= mtime:
4444
print 'Yes.'
4545
todo.append(name)
@@ -55,7 +55,7 @@ def packtree(outfp, dirname):
5555
names = mac.listdir(dirname)
5656
subdirs = []
5757
for name in names:
58-
fullname = macpath.cat(dirname, name)
58+
fullname = macpath.join(dirname, name)
5959
if macpath.isdir(fullname):
6060
subdirs.append(fullname)
6161
else:

Lib/macpath.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def isabs(s):
1515
return ':' in s and s[0] <> ':'
1616

1717

18-
# Concatenate two pathnames.
18+
# Join two pathnames.
1919
# The result is equivalent to what the second pathname would refer to
2020
# if the first pathname were the current directory.
2121

22-
def cat(s, t):
22+
def join(s, t):
2323
if (not s) or isabs(t): return t
2424
if t[:1] = ':': t = t[1:]
2525
if ':' not in s:
@@ -29,9 +29,12 @@ def cat(s, t):
2929
return s + t
3030

3131

32+
cat = join # For compatibility
33+
34+
3235
# Split a pathname in two parts: the directory leading up to the final bit,
3336
# and the basename (the filename, without colons, in that directory).
34-
# The result (s, t) is such that cat(s, t) yields the original argument.
37+
# The result (s, t) is such that join(s, t) yields the original argument.
3538

3639
def split(s):
3740
if ':' not in s: return '', s

Lib/packmail.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def pack(outfp, file, name):
2121
def packsome(outfp, dirname, names):
2222
for name in names:
2323
print name
24-
file = macpath.cat(dirname, name)
24+
file = macpath.join(dirname, name)
2525
pack(outfp, file, name)
2626

2727
# Pack all files from a directory
@@ -33,13 +33,13 @@ def packall(outfp, dirname):
3333
# Pack all files from a directory that are not older than a give one
3434
def packnotolder(outfp, dirname, oldest):
3535
names = mac.listdir(dirname)
36-
oldest = macpath.cat(dirname, oldest)
36+
oldest = macpath.join(dirname, oldest)
3737
st = mac.stat(oldest)
3838
mtime = st[ST_MTIME]
3939
todo = []
4040
for name in names:
4141
print name, '...',
42-
st = mac.stat(macpath.cat(dirname, name))
42+
st = mac.stat(macpath.join(dirname, name))
4343
if st[ST_MTIME] >= mtime:
4444
print 'Yes.'
4545
todo.append(name)
@@ -55,7 +55,7 @@ def packtree(outfp, dirname):
5555
names = mac.listdir(dirname)
5656
subdirs = []
5757
for name in names:
58-
fullname = macpath.cat(dirname, name)
58+
fullname = macpath.join(dirname, name)
5959
if macpath.isdir(fullname):
6060
subdirs.append(fullname)
6161
else:

Mac/Lib/maccache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
LISTTYPE = type([])
2626

2727
def _stat(name):
28-
name = macpath.cat(cwd, name)
28+
name = macpath.join(cwd, name)
2929
if cache.has_key(name):
3030
return cache[name]
3131
if macpath.isfile(name):

0 commit comments

Comments
 (0)