mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-09 21:24: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:
parent
5dc78809b6
commit
9a7bb30df4
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user