]> granicus.if.org Git - python/commitdiff
Got rid of macfs.
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 6 Feb 2003 23:13:11 +0000 (23:13 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 6 Feb 2003 23:13:11 +0000 (23:13 +0000)
Mac/scripts/fixfiletypes.py

index 872c891e99fae52e441a4382f7c0550964a740b8..bbbf80761ccabfb18499decc988b5c8d6d0c62f2 100644 (file)
@@ -8,10 +8,10 @@
 # Jack Jansen, CWI, 1995.
 #
 import os
-import macfs
 import EasyDialogs
 import sys
 import macostools
+import MacOS
 
 list = [
        ('.py', 'Pyth', 'TEXT'),
@@ -30,11 +30,10 @@ def walktree(name, change):
        if os.path.isfile(name):
                for ext, cr, tp in list:
                        if name[-len(ext):] == ext:
-                               fs = macfs.FSSpec(name)
-                               curcrtp = fs.GetCreatorType()
+                               curcrtp = MacOS.GetCreatorAndType(name)
                                if curcrtp <> (cr, tp):
                                        if change:
-                                               fs.SetCreatorType(cr, tp)
+                                               MacOS.SetCreatorAndType(name, cr, tp)
                                                macostools.touched(fs)
                                                print 'Fixed ', name
                                        else:
@@ -52,6 +51,6 @@ def run(change):
        walktree(pathname, change)
        
 if __name__ == '__main__':
-       run(1)
+       run(0)