mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Explicited pyobjc imports.
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import objc
|
||||
from Foundation import *
|
||||
from AppKit import *
|
||||
from Foundation import (NSNotificationCenter, NSUserDefaults, NSSearchPathForDirectoriesInDomains,
|
||||
NSApplicationSupportDirectory, NSUserDomainMask)
|
||||
import logging
|
||||
import os.path as op
|
||||
|
||||
from hsutil import io, cocoa, job
|
||||
from hsutil import cocoa, job
|
||||
from hsutil.cocoa import install_exception_hook
|
||||
from hsutil.misc import stripnone
|
||||
from hsutil.reg import RegistrationRequired
|
||||
@@ -53,6 +53,8 @@ class DupeGuru(app.DupeGuru):
|
||||
#--- Override
|
||||
@staticmethod
|
||||
def _recycle_dupe(dupe):
|
||||
# local import because first appkit import takes a lot of memory. we want to avoid it.
|
||||
from AppKit import NSWorkspace, NSWorkspaceRecycleOperation
|
||||
directory = unicode(dupe.path[:-1])
|
||||
filename = dupe.name
|
||||
if objc.__version__ == '1.4': # For a while, we have to support this.
|
||||
@@ -114,6 +116,8 @@ class DupeGuru(app.DupeGuru):
|
||||
self.make_reference(self.selected_dupes)
|
||||
|
||||
def OpenSelected(self):
|
||||
# local import because first appkit import takes a lot of memory. we want to avoid it.
|
||||
from AppKit import NSWorkspace
|
||||
if self.selected_dupes:
|
||||
path = unicode(self.selected_dupes[0].path)
|
||||
NSWorkspace.sharedWorkspace().openFile_(path)
|
||||
@@ -149,6 +153,8 @@ class DupeGuru(app.DupeGuru):
|
||||
return False
|
||||
|
||||
def RevealSelected(self):
|
||||
# local import because first appkit import takes a lot of memory. we want to avoid it.
|
||||
from AppKit import NSWorkspace
|
||||
if self.selected_dupes:
|
||||
path = unicode(self.selected_dupes[0].path)
|
||||
NSWorkspace.sharedWorkspace().selectFile_inFileViewerRootedAtPath_(path,'')
|
||||
|
||||
Reference in New Issue
Block a user