dgse cocoa: Since there are problems with the latest pyobjc + py2app + Snow Leopard, I've got to stick with pyobjc1.4 for a while after all...

--HG--
extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40263
This commit is contained in:
hsoft 2009-12-16 14:48:18 +00:00
parent 5dc78809b6
commit 9a7bb30df4
1 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,7 @@ from __future__ import unicode_literals
import logging
import objc
from AppKit import *
from hsutil import io
@ -25,7 +26,10 @@ from .fs import Bundle as BundleBase
def is_bundle(str_path):
sw = NSWorkspace.sharedWorkspace()
uti, error = sw.typeOfFile_error_(str_path, None)
if objc.__version__ == '1.4': # For a while, we have to support this.
uti, error = sw.typeOfFile_error_(str_path)
else:
uti, error = sw.typeOfFile_error_(str_path, None)
if error is not None:
logging.warning(u'There was an error trying to detect the UTI of %s', str_path)
return sw.type_conformsToType_(uti, 'com.apple.bundle') or sw.type_conformsToType_(uti, 'com.apple.package')