mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-24 23:51:38 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75239d6a64 | ||
|
|
09082955a3 | ||
|
|
6a6f2d51aa |
1
.hgtags
1
.hgtags
@@ -37,3 +37,4 @@ b07ac1398703dd358912c1f3d20bd995633db9fe pe1.11.0
|
||||
f9cae82a0752191276b24ffb2cc4e4a8afb5d754 me5.10.2
|
||||
154c8cb6f018d446d88fa099490c900906e86386 pe1.11.2
|
||||
ca93352ce35184853ad9fcb881935a43a8b1e249 me5.10.3
|
||||
44f6ff67066c083f79daa18a9d2f1ab909e0a62e me5.10.4
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>hsft</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.11.2</string>
|
||||
<string>1.11.3</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -63,13 +63,16 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[_py setIgnoreHardlinkMatches:n2b([ud objectForKey:@"ignoreHardlinkMatches"])];
|
||||
[_py setMatchScaled:[ud objectForKey:@"matchScaled"]];
|
||||
int r = n2i([py doScan]);
|
||||
if (r != 0)
|
||||
if (r != 0) {
|
||||
[[ProgressController mainProgressController] hide];
|
||||
if (r == 3)
|
||||
{
|
||||
}
|
||||
if (r == 3) {
|
||||
[Dialogs showMessage:@"The selected directories contain no scannable file."];
|
||||
[app toggleDirectories:nil];
|
||||
}
|
||||
if (r == 4) {
|
||||
[Dialogs showMessage:@"The iPhoto application couldn't be found."];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)toggleDirectories:(id)sender
|
||||
|
||||
@@ -11,7 +11,7 @@ import plistlib
|
||||
import logging
|
||||
import re
|
||||
|
||||
from appscript import app, k, CommandError
|
||||
from appscript import app, k, CommandError, ApplicationNotFoundError
|
||||
|
||||
from hsutil import io
|
||||
from hsutil.str import get_file_ext, remove_invalid_xml
|
||||
@@ -24,12 +24,14 @@ from core import app_cocoa, directories
|
||||
from . import data, _block_osx
|
||||
from .scanner import ScannerPE
|
||||
|
||||
IPHOTO_PATH = Path('iPhoto Library')
|
||||
|
||||
class Photo(fs.File):
|
||||
INITIAL_INFO = fs.File.INITIAL_INFO.copy()
|
||||
INITIAL_INFO.update({
|
||||
'dimensions': (0,0),
|
||||
})
|
||||
HANDLED_EXTS = set(['png', 'jpg', 'jpeg', 'gif', 'psd', 'bmp', 'tiff', 'tif', 'nef', 'cr2'])
|
||||
HANDLED_EXTS = {'png', 'jpg', 'jpeg', 'gif', 'psd', 'bmp', 'tiff', 'tif', 'nef', 'cr2'}
|
||||
|
||||
@classmethod
|
||||
def can_handle(cls, path):
|
||||
@@ -97,7 +99,7 @@ class Directories(directories.Directories):
|
||||
self.iphoto_libpath = None
|
||||
|
||||
def _get_files(self, from_path):
|
||||
if from_path == Path('iPhoto Library'):
|
||||
if from_path == IPHOTO_PATH:
|
||||
if self.iphoto_libpath is None:
|
||||
return []
|
||||
is_ref = self.get_state(from_path) == directories.STATE_REFERENCE
|
||||
@@ -110,23 +112,26 @@ class Directories(directories.Directories):
|
||||
|
||||
@staticmethod
|
||||
def get_subfolders(path):
|
||||
if path == Path('iPhoto Library'):
|
||||
if path == IPHOTO_PATH:
|
||||
return []
|
||||
else:
|
||||
return directories.Directories.get_subfolders(path)
|
||||
|
||||
def add_path(self, path):
|
||||
if path == Path('iPhoto Library'):
|
||||
if path == IPHOTO_PATH:
|
||||
if path not in self:
|
||||
self._dirs.append(path)
|
||||
else:
|
||||
directories.Directories.add_path(self, path)
|
||||
|
||||
def has_iphoto_path(self):
|
||||
return any(path == IPHOTO_PATH for path in self._dirs)
|
||||
|
||||
def has_any_file(self):
|
||||
# If we don't do that, it causes a hangup in the GUI when we click Start Scanning because
|
||||
# checking if there's any file to scan involves reading the whole library. If we have the
|
||||
# iPhoto library, we assume we have at least one file.
|
||||
if any(path == Path('iPhoto Library') for path in self._dirs):
|
||||
if self.has_iphoto_path():
|
||||
return True
|
||||
else:
|
||||
return directories.Directories.has_any_file(self)
|
||||
@@ -158,7 +163,7 @@ class DupeGuruPE(app_cocoa.DupeGuru):
|
||||
self.path2iphoto[str(photo.image_path(timeout=0))] = photo
|
||||
except CommandError:
|
||||
pass
|
||||
except (CommandError, RuntimeError):
|
||||
except (CommandError, RuntimeError, ApplicationNotFoundError):
|
||||
pass
|
||||
j.start_job(self.results.mark_count, "Sending dupes to the Trash")
|
||||
self.results.perform_on_marked(op, True)
|
||||
@@ -203,3 +208,12 @@ class DupeGuruPE(app_cocoa.DupeGuru):
|
||||
return None
|
||||
return ref.path
|
||||
|
||||
def start_scanning(self):
|
||||
result = app_cocoa.DupeGuru.start_scanning(self)
|
||||
if self.directories.has_iphoto_path():
|
||||
try:
|
||||
app('iPhoto')
|
||||
except ApplicationNotFoundError:
|
||||
return 4
|
||||
return result
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
- date: 2010-12-31
|
||||
version: 1.11.3
|
||||
description: |
|
||||
* Fixed bug causing results to be corrupted after a scan cancellation. (#120)
|
||||
* Fixed crash when fetching Fairware unpaid hours. (#121)
|
||||
* Fixed crash when replacing files with hardlinks. (#122)
|
||||
* Fixed crash when iPhoto can't be found. (#125)
|
||||
- date: 2010-10-07
|
||||
version: 1.11.2
|
||||
description: |
|
||||
|
||||
@@ -60,7 +60,7 @@ class DupeGuru(DupeGuruBase):
|
||||
EDITION = 'pe'
|
||||
LOGO_NAME = 'logo_pe'
|
||||
NAME = 'dupeGuru Picture Edition'
|
||||
VERSION = '1.11.2'
|
||||
VERSION = '1.11.3'
|
||||
DELTA_COLUMNS = frozenset([2, 5])
|
||||
|
||||
def __init__(self):
|
||||
|
||||
Reference in New Issue
Block a user