mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Use hsutil.cocoa.objcmin instead of Foundation and AppKit.
This commit is contained in:
@@ -10,11 +10,9 @@ from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
|
||||
import objc
|
||||
from AppKit import NSWorkspace
|
||||
|
||||
from hsutil import io
|
||||
from hsutil.path import Path
|
||||
from hsutil.cocoa.objcmin import NSWorkspace
|
||||
|
||||
from core import fs
|
||||
from core.app_cocoa import DupeGuru as DupeGuruBase
|
||||
@@ -24,10 +22,7 @@ from .fs import Bundle as BundleBase
|
||||
|
||||
def is_bundle(str_path):
|
||||
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:
|
||||
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')
|
||||
|
||||
Reference in New Issue
Block a user