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:
parent
5dc78809b6
commit
9a7bb30df4
@ -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,7 +26,10 @@ from .fs import Bundle as BundleBase
|
|||||||
|
|
||||||
def is_bundle(str_path):
|
def is_bundle(str_path):
|
||||||
sw = NSWorkspace.sharedWorkspace()
|
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:
|
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)
|
||||||
return sw.type_conformsToType_(uti, 'com.apple.bundle') or sw.type_conformsToType_(uti, 'com.apple.package')
|
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