Getting rid of macfs and FSSpecs.

This commit is contained in:
Jack Jansen 2003-02-05 15:49:19 +00:00
parent d66071b48d
commit cf0b2e8e28
1 changed files with 5 additions and 7 deletions

View File

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