]> granicus.if.org Git - python/commitdiff
Getting rid of macfs and FSSpecs.
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 5 Feb 2003 15:49:19 +0000 (15:49 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 5 Feb 2003 15:49:19 +0000 (15:49 +0000)
Lib/plat-mac/ic.py

index 3c0272cf1de128acb8b1206aab1c38499a94b97a..ff3c571b461108d8cd834c1d00ac1bb9feb46838 100644 (file)
@@ -3,7 +3,9 @@
 import icglue
 import string
 import sys
+import os
 from Carbon import Res
+import Carbon.File
 import macfs
 import macostools
 
@@ -216,13 +218,9 @@ class IC:
                return self.ic.ICMapTypeCreator(type, creator, filename)
                
        def settypecreator(self, file):
-               if type(file) == type(''):
-                       fss = macfs.FSSpec(file)
-               else:
-                       fss = file
-               name = fss.as_tuple()[2]
-               record = self.mapfile(name)
-               fss.SetCreatorType(record[2], record[1])
+               file = Carbon.File.pathname(file)
+               record = self.mapfile(os.path.split(file)[1])
+               MacOS.SetCreatorAndType(file, record[2], record[1])
                macostools.touched(fss)
                
 # Convenience routines