1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-10 05:34:36 +00:00

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

View File

@ -11,6 +11,7 @@ from __future__ import unicode_literals
import logging import logging
import objc
from AppKit import * from AppKit import *
from hsutil import io from hsutil import io
@ -25,6 +26,9 @@ from .fs import Bundle as BundleBase
def is_bundle(str_path): def is_bundle(str_path):
sw = NSWorkspace.sharedWorkspace() sw = NSWorkspace.sharedWorkspace()
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) uti, error = sw.typeOfFile_error_(str_path, None)
if error is not None: if error is not None:
logging.warning(u'There was an error trying to detect the UTI of %s', str_path) logging.warning(u'There was an error trying to detect the UTI of %s', str_path)