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

Skip to content

Commit d9596e3

Browse files
committed
mac -> os
1 parent 25d7caf commit d9596e3

2 files changed

Lines changed: 20 additions & 22 deletions

File tree

Lib/lib-old/packmail.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Module 'packmail' -- create a shell script out of some files.
22

3-
import mac
4-
import macpath
3+
import os
54
from stat import ST_MTIME
65
import string
76

@@ -21,25 +20,25 @@ def pack(outfp, file, name):
2120
def packsome(outfp, dirname, names):
2221
for name in names:
2322
print name
24-
file = macpath.join(dirname, name)
23+
file = os.path.join(dirname, name)
2524
pack(outfp, file, name)
2625

2726
# Pack all files from a directory
2827
def packall(outfp, dirname):
29-
names = mac.listdir(dirname)
28+
names = os.listdir(dirname)
3029
names.sort()
3130
packsome(outfp, dirname, names)
3231

3332
# Pack all files from a directory that are not older than a give one
3433
def packnotolder(outfp, dirname, oldest):
35-
names = mac.listdir(dirname)
36-
oldest = macpath.join(dirname, oldest)
37-
st = mac.stat(oldest)
34+
names = os.listdir(dirname)
35+
oldest = os.path.join(dirname, oldest)
36+
st = os.stat(oldest)
3837
mtime = st[ST_MTIME]
3938
todo = []
4039
for name in names:
4140
print name, '...',
42-
st = mac.stat(macpath.join(dirname, name))
41+
st = os.stat(os.path.join(dirname, name))
4342
if st[ST_MTIME] >= mtime:
4443
print 'Yes.'
4544
todo.append(name)
@@ -52,11 +51,11 @@ def packnotolder(outfp, dirname, oldest):
5251
def packtree(outfp, dirname):
5352
print 'packtree', dirname
5453
outfp.write('mkdir ' + unixfix(dirname) + '\n')
55-
names = mac.listdir(dirname)
54+
names = os.listdir(dirname)
5655
subdirs = []
5756
for name in names:
58-
fullname = macpath.join(dirname, name)
59-
if macpath.isdir(fullname):
57+
fullname = os.path.join(dirname, name)
58+
if os.path.isdir(fullname):
6059
subdirs.append(fullname)
6160
else:
6261
print 'pack', fullname

Lib/packmail.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Module 'packmail' -- create a shell script out of some files.
22

3-
import mac
4-
import macpath
3+
import os
54
from stat import ST_MTIME
65
import string
76

@@ -21,25 +20,25 @@ def pack(outfp, file, name):
2120
def packsome(outfp, dirname, names):
2221
for name in names:
2322
print name
24-
file = macpath.join(dirname, name)
23+
file = os.path.join(dirname, name)
2524
pack(outfp, file, name)
2625

2726
# Pack all files from a directory
2827
def packall(outfp, dirname):
29-
names = mac.listdir(dirname)
28+
names = os.listdir(dirname)
3029
names.sort()
3130
packsome(outfp, dirname, names)
3231

3332
# Pack all files from a directory that are not older than a give one
3433
def packnotolder(outfp, dirname, oldest):
35-
names = mac.listdir(dirname)
36-
oldest = macpath.join(dirname, oldest)
37-
st = mac.stat(oldest)
34+
names = os.listdir(dirname)
35+
oldest = os.path.join(dirname, oldest)
36+
st = os.stat(oldest)
3837
mtime = st[ST_MTIME]
3938
todo = []
4039
for name in names:
4140
print name, '...',
42-
st = mac.stat(macpath.join(dirname, name))
41+
st = os.stat(os.path.join(dirname, name))
4342
if st[ST_MTIME] >= mtime:
4443
print 'Yes.'
4544
todo.append(name)
@@ -52,11 +51,11 @@ def packnotolder(outfp, dirname, oldest):
5251
def packtree(outfp, dirname):
5352
print 'packtree', dirname
5453
outfp.write('mkdir ' + unixfix(dirname) + '\n')
55-
names = mac.listdir(dirname)
54+
names = os.listdir(dirname)
5655
subdirs = []
5756
for name in names:
58-
fullname = macpath.join(dirname, name)
59-
if macpath.isdir(fullname):
57+
fullname = os.path.join(dirname, name)
58+
if os.path.isdir(fullname):
6059
subdirs.append(fullname)
6160
else:
6261
print 'pack', fullname

0 commit comments

Comments
 (0)