mirror of
https://github.com/python/cpython.git
synced 2025-11-12 07:02:33 +00:00
Got rid of macfs.
This commit is contained in:
parent
caaad98ebd
commit
658375b833
1 changed files with 4 additions and 5 deletions
|
|
@ -8,10 +8,10 @@
|
||||||
# Jack Jansen, CWI, 1995.
|
# Jack Jansen, CWI, 1995.
|
||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
import macfs
|
|
||||||
import EasyDialogs
|
import EasyDialogs
|
||||||
import sys
|
import sys
|
||||||
import macostools
|
import macostools
|
||||||
|
import MacOS
|
||||||
|
|
||||||
list = [
|
list = [
|
||||||
('.py', 'Pyth', 'TEXT'),
|
('.py', 'Pyth', 'TEXT'),
|
||||||
|
|
@ -30,11 +30,10 @@ def walktree(name, change):
|
||||||
if os.path.isfile(name):
|
if os.path.isfile(name):
|
||||||
for ext, cr, tp in list:
|
for ext, cr, tp in list:
|
||||||
if name[-len(ext):] == ext:
|
if name[-len(ext):] == ext:
|
||||||
fs = macfs.FSSpec(name)
|
curcrtp = MacOS.GetCreatorAndType(name)
|
||||||
curcrtp = fs.GetCreatorType()
|
|
||||||
if curcrtp <> (cr, tp):
|
if curcrtp <> (cr, tp):
|
||||||
if change:
|
if change:
|
||||||
fs.SetCreatorType(cr, tp)
|
MacOS.SetCreatorAndType(name, cr, tp)
|
||||||
macostools.touched(fs)
|
macostools.touched(fs)
|
||||||
print 'Fixed ', name
|
print 'Fixed ', name
|
||||||
else:
|
else:
|
||||||
|
|
@ -52,6 +51,6 @@ def run(change):
|
||||||
walktree(pathname, change)
|
walktree(pathname, change)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run(1)
|
run(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue