1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-25 08:01:39 +00:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Virgil Dupras
75239d6a64 pe v1.11.3 2010-12-31 14:43:00 +01:00
Virgil Dupras
09082955a3 [#125 state:fixed] Wrapped error message around a crash when the iPhoto app can't be found. 2010-12-31 12:10:44 +01:00
Virgil Dupras
6a6f2d51aa Added tag me5.10.4 for changeset 44f6ff67066c 2010-12-30 16:11:17 +01:00
6 changed files with 37 additions and 12 deletions

View File

@@ -37,3 +37,4 @@ b07ac1398703dd358912c1f3d20bd995633db9fe pe1.11.0
f9cae82a0752191276b24ffb2cc4e4a8afb5d754 me5.10.2 f9cae82a0752191276b24ffb2cc4e4a8afb5d754 me5.10.2
154c8cb6f018d446d88fa099490c900906e86386 pe1.11.2 154c8cb6f018d446d88fa099490c900906e86386 pe1.11.2
ca93352ce35184853ad9fcb881935a43a8b1e249 me5.10.3 ca93352ce35184853ad9fcb881935a43a8b1e249 me5.10.3
44f6ff67066c083f79daa18a9d2f1ab909e0a62e me5.10.4

View File

@@ -23,7 +23,7 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>hsft</string> <string>hsft</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.11.2</string> <string>1.11.3</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View File

@@ -63,13 +63,16 @@ http://www.hardcoded.net/licenses/bsd_license
[_py setIgnoreHardlinkMatches:n2b([ud objectForKey:@"ignoreHardlinkMatches"])]; [_py setIgnoreHardlinkMatches:n2b([ud objectForKey:@"ignoreHardlinkMatches"])];
[_py setMatchScaled:[ud objectForKey:@"matchScaled"]]; [_py setMatchScaled:[ud objectForKey:@"matchScaled"]];
int r = n2i([py doScan]); int r = n2i([py doScan]);
if (r != 0) if (r != 0) {
[[ProgressController mainProgressController] hide]; [[ProgressController mainProgressController] hide];
if (r == 3) }
{ if (r == 3) {
[Dialogs showMessage:@"The selected directories contain no scannable file."]; [Dialogs showMessage:@"The selected directories contain no scannable file."];
[app toggleDirectories:nil]; [app toggleDirectories:nil];
} }
if (r == 4) {
[Dialogs showMessage:@"The iPhoto application couldn't be found."];
}
} }
- (IBAction)toggleDirectories:(id)sender - (IBAction)toggleDirectories:(id)sender

View File

@@ -11,7 +11,7 @@ import plistlib
import logging import logging
import re import re
from appscript import app, k, CommandError from appscript import app, k, CommandError, ApplicationNotFoundError
from hsutil import io from hsutil import io
from hsutil.str import get_file_ext, remove_invalid_xml 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 . import data, _block_osx
from .scanner import ScannerPE from .scanner import ScannerPE
IPHOTO_PATH = Path('iPhoto Library')
class Photo(fs.File): class Photo(fs.File):
INITIAL_INFO = fs.File.INITIAL_INFO.copy() INITIAL_INFO = fs.File.INITIAL_INFO.copy()
INITIAL_INFO.update({ INITIAL_INFO.update({
'dimensions': (0,0), '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 @classmethod
def can_handle(cls, path): def can_handle(cls, path):
@@ -97,7 +99,7 @@ class Directories(directories.Directories):
self.iphoto_libpath = None self.iphoto_libpath = None
def _get_files(self, from_path): def _get_files(self, from_path):
if from_path == Path('iPhoto Library'): if from_path == IPHOTO_PATH:
if self.iphoto_libpath is None: if self.iphoto_libpath is None:
return [] return []
is_ref = self.get_state(from_path) == directories.STATE_REFERENCE is_ref = self.get_state(from_path) == directories.STATE_REFERENCE
@@ -110,23 +112,26 @@ class Directories(directories.Directories):
@staticmethod @staticmethod
def get_subfolders(path): def get_subfolders(path):
if path == Path('iPhoto Library'): if path == IPHOTO_PATH:
return [] return []
else: else:
return directories.Directories.get_subfolders(path) return directories.Directories.get_subfolders(path)
def add_path(self, path): def add_path(self, path):
if path == Path('iPhoto Library'): if path == IPHOTO_PATH:
if path not in self: if path not in self:
self._dirs.append(path) self._dirs.append(path)
else: else:
directories.Directories.add_path(self, path) 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): def has_any_file(self):
# If we don't do that, it causes a hangup in the GUI when we click Start Scanning because # 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 # 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. # 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 return True
else: else:
return directories.Directories.has_any_file(self) 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 self.path2iphoto[str(photo.image_path(timeout=0))] = photo
except CommandError: except CommandError:
pass pass
except (CommandError, RuntimeError): except (CommandError, RuntimeError, ApplicationNotFoundError):
pass pass
j.start_job(self.results.mark_count, "Sending dupes to the Trash") j.start_job(self.results.mark_count, "Sending dupes to the Trash")
self.results.perform_on_marked(op, True) self.results.perform_on_marked(op, True)
@@ -203,3 +208,12 @@ class DupeGuruPE(app_cocoa.DupeGuru):
return None return None
return ref.path 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

View File

@@ -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 - date: 2010-10-07
version: 1.11.2 version: 1.11.2
description: | description: |

View File

@@ -60,7 +60,7 @@ class DupeGuru(DupeGuruBase):
EDITION = 'pe' EDITION = 'pe'
LOGO_NAME = 'logo_pe' LOGO_NAME = 'logo_pe'
NAME = 'dupeGuru Picture Edition' NAME = 'dupeGuru Picture Edition'
VERSION = '1.11.2' VERSION = '1.11.3'
DELTA_COLUMNS = frozenset([2, 5]) DELTA_COLUMNS = frozenset([2, 5])
def __init__(self): def __init__(self):