mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-25 16:11:39 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8bb40de62 | ||
|
|
67dff7fbf2 | ||
|
|
6e226f32fd | ||
|
|
cf819dc0a8 | ||
|
|
4f6af6e4dc | ||
|
|
a6d2a9b7b3 | ||
|
|
cf34164191 | ||
|
|
9a7bb30df4 | ||
|
|
5dc78809b6 | ||
|
|
2b53a6e7d6 | ||
|
|
eb82a35e5b | ||
|
|
51b14435e0 | ||
|
|
59de033523 | ||
|
|
c9b0a278ca | ||
|
|
b487189742 | ||
|
|
d5a60b1580 | ||
|
|
e2665610e9 | ||
|
|
3262ee9938 | ||
|
|
2f153003b3 |
@@ -403,7 +403,11 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
if ([lastAction isEqualTo:jobDelete])
|
||||
{
|
||||
if (r > 0)
|
||||
[Dialogs showMessage:[NSString stringWithFormat:@"%d file(s) couldn't be sent to Trash. They were kept in the results, and still are marked.",r]];
|
||||
{
|
||||
NSString *msg = @"%d file(s) couldn't be sent to Trash. They were kept in the results, "\
|
||||
"and still are marked. See the F.A.Q. section in the help file for details.";
|
||||
[Dialogs showMessage:[NSString stringWithFormat:msg,r]];
|
||||
}
|
||||
else
|
||||
[Dialogs showMessage:@"All marked files were sucessfully sent to Trash."];
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import objc
|
||||
from Foundation import *
|
||||
from AppKit import *
|
||||
import logging
|
||||
@@ -55,6 +56,10 @@ class DupeGuru(app.DupeGuru):
|
||||
def _recycle_dupe(dupe):
|
||||
directory = unicode(dupe.path[:-1])
|
||||
filename = dupe.name
|
||||
if objc.__version__ == '1.4': # For a while, we have to support this.
|
||||
result, tag = NSWorkspace.sharedWorkspace().performFileOperation_source_destination_files_tag_(
|
||||
NSWorkspaceRecycleOperation, directory, '', [filename])
|
||||
else:
|
||||
result, tag = NSWorkspace.sharedWorkspace().performFileOperation_source_destination_files_tag_(
|
||||
NSWorkspaceRecycleOperation, directory, '', [filename], None)
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
DupeGuruBase.apply_filter(self, filter)
|
||||
self.emit(SIGNAL('resultsChanged()'))
|
||||
|
||||
def ask_for_reg_code(self):
|
||||
def askForRegCode(self):
|
||||
self.reg.ask_for_code()
|
||||
|
||||
@demo_method
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
import urllib
|
||||
|
||||
from PyQt4.QtCore import QModelIndex, Qt, QRect, QEvent, QPoint, QUrl
|
||||
from PyQt4.QtGui import QComboBox, QStyledItemDelegate, QMouseEvent, QApplication, QBrush
|
||||
from PyQt4.QtGui import (QComboBox, QStyledItemDelegate, QMouseEvent, QApplication, QBrush, QStyle,
|
||||
QStyleOptionComboBox, QStyleOptionViewItemV4)
|
||||
|
||||
from qtlib.tree_model import TreeNode, TreeModel
|
||||
|
||||
@@ -23,6 +24,24 @@ class DirectoriesDelegate(QStyledItemDelegate):
|
||||
editor.addItems(STATES)
|
||||
return editor
|
||||
|
||||
def paint(self, painter, option, index):
|
||||
self.initStyleOption(option, index)
|
||||
# No idea why, but this cast is required if we want to have access to the V4 valuess
|
||||
option = QStyleOptionViewItemV4(option)
|
||||
if (index.column() == 1) and (option.state & QStyle.State_Selected):
|
||||
cboption = QStyleOptionComboBox()
|
||||
cboption.rect = option.rect
|
||||
# On OS X (with Qt4.6.0), adding State_Enabled to the flags causes the whole drawing to
|
||||
# fail (draw nothing), but it's an OS X only glitch. On Windows, it works alright.
|
||||
cboption.state |= QStyle.State_Enabled
|
||||
QApplication.style().drawComplexControl(QStyle.CC_ComboBox, cboption, painter)
|
||||
painter.setBrush(option.palette.text())
|
||||
rect = QRect(option.rect)
|
||||
rect.setLeft(rect.left()+4)
|
||||
painter.drawText(rect, Qt.AlignLeft, option.text)
|
||||
else:
|
||||
QStyledItemDelegate.paint(self, painter, option, index)
|
||||
|
||||
def setEditorData(self, editor, index):
|
||||
value = index.model().data(index, Qt.EditRole)
|
||||
editor.setCurrentIndex(value);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>hsft</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>5.6.6</string>
|
||||
<string>5.7.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -5,13 +5,15 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, 'py') # for hsutil and hsdocgen
|
||||
import os
|
||||
|
||||
from help import gen
|
||||
|
||||
print "Generating help"
|
||||
os.chdir('help')
|
||||
os.system('python -u gen.py')
|
||||
os.system('/Developer/Applications/Utilities/Help\\ Indexer.app/Contents/MacOS/Help\\ Indexer dupeguru_me_help')
|
||||
os.chdir('..')
|
||||
gen.generate()
|
||||
os.system('/Developer/Applications/Utilities/Help\\ Indexer.app/Contents/MacOS/Help\\ Indexer help/dupeguru_me_help')
|
||||
|
||||
print "Generating py plugin"
|
||||
os.chdir('py')
|
||||
|
||||
0
me/help/__init__.py
Normal file
0
me/help/__init__.py
Normal file
@@ -1,3 +1,12 @@
|
||||
- date: 2009-12-18
|
||||
version: 5.7.0
|
||||
description: |
|
||||
* Added drag & drop support in the Directories panel. (#9)
|
||||
* Fixed a bug causing dupeGuru to be confused if a scanned file was moved during the scan. (#72)
|
||||
* Clarified how directories' state are set by painting a combo box in the state cells. [Windows]
|
||||
(#76)
|
||||
* Fixed some crashes. (#78 and #79)
|
||||
* Dropped Mac OS X Tiger support.
|
||||
- date: 2009-10-14
|
||||
version: 5.6.6
|
||||
description: |
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os
|
||||
|
||||
import os.path as op
|
||||
from hsdocgen import generate_help, filters
|
||||
|
||||
def generate(windows=False):
|
||||
tix = filters.tixgen("https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}")
|
||||
|
||||
generate_help.main('.', 'dupeguru_me_help', force_render=True, tix=tix)
|
||||
basepath = op.dirname(__file__)
|
||||
generate_help.main(basepath, op.join(basepath, 'dupeguru_me_help'), force_render=True, tix=tix, windows=windows)
|
||||
|
||||
@@ -64,4 +64,12 @@ If your comparison threshold is low enough, you will probably end up with live a
|
||||
* **Mac OS X**: Type "[*]" in the "Filter" field in the toolbar.
|
||||
* Click on **Mark --> Mark All**.
|
||||
* Click on **Actions --> Remove Selected from Results**.
|
||||
|
||||
### I tried to send my duplicates to Trash, but dupeGuru is telling me it can't do it. Why? What can I do?
|
||||
|
||||
Most of the time, the reason why dupeGuru can't send files to Trash is because of file permissions. You need *write* permissions on files you want to send to Trash. If you're not familiar with the command line, you can use utilities such as [BatChmod](http://macchampion.com/arbysoft/BatchMod) to fix your permissions.
|
||||
|
||||
If dupeGuru still gives you troubles after fixing your permissions, there have been some cases where using "Move Marked to..." as a workaround did the trick. So instead of sending your files to Trash, you send them to a temporary folder with the "Move Marked to..." action, and then you delete that temporary folder manually.
|
||||
|
||||
If all of this fail, [contact HS support](http://www.hardcoded.net/support), we'll figure it out.
|
||||
</%text>
|
||||
@@ -17,7 +17,7 @@ from preferences_dialog import PreferencesDialog
|
||||
class DupeGuru(DupeGuruBase):
|
||||
LOGO_NAME = 'logo_me'
|
||||
NAME = 'dupeGuru Music Edition'
|
||||
VERSION = '5.6.6'
|
||||
VERSION = '5.7.0'
|
||||
DELTA_COLUMNS = frozenset([2, 3, 4, 5, 7, 8])
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -13,10 +13,13 @@ import os.path as op
|
||||
|
||||
from hsutil.build import print_and_do, build_all_qt_ui
|
||||
|
||||
from help import gen
|
||||
|
||||
build_all_qt_ui(op.join('qtlib', 'ui'))
|
||||
build_all_qt_ui('base')
|
||||
build_all_qt_ui('.')
|
||||
|
||||
os.chdir('help')
|
||||
print_and_do('python gen.py')
|
||||
os.chdir('base')
|
||||
print_and_do("pyrcc4 dg.qrc > dg_rc.py")
|
||||
os.chdir('..')
|
||||
|
||||
gen.generate(windows=True)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>hsft</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.0b</string>
|
||||
<string>1.8.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objectVersion = 44;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
@@ -360,7 +360,7 @@
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "dupeguru" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
compatibilityVersion = "Xcode 3.0";
|
||||
hasScannedForEncodings = 1;
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* dupeguru */;
|
||||
projectDirPath = "";
|
||||
@@ -480,12 +480,13 @@
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
|
||||
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||
SDKROOT = macosx10.5;
|
||||
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -5,13 +5,15 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, 'py') # for hsutil and hsdocgen
|
||||
import os
|
||||
|
||||
from help import gen
|
||||
|
||||
print "Generating help"
|
||||
os.chdir('help')
|
||||
os.system('python -u gen.py')
|
||||
os.system('/Developer/Applications/Utilities/Help\\ Indexer.app/Contents/MacOS/Help\\ Indexer dupeguru_pe_help')
|
||||
os.chdir('..')
|
||||
gen.generate()
|
||||
os.system('/Developer/Applications/Utilities/Help\\ Indexer.app/Contents/MacOS/Help\\ Indexer help/dupeguru_pe_help')
|
||||
|
||||
print "Generating py plugin"
|
||||
os.chdir('py')
|
||||
|
||||
0
pe/help/__init__.py
Normal file
0
pe/help/__init__.py
Normal file
@@ -1,3 +1,12 @@
|
||||
- date: 2009-12-16
|
||||
version: 1.8.0
|
||||
description: |
|
||||
* Added drag & drop support in the Directories panel. (#9)
|
||||
* Fixed a bug causing dupeGuru to be confused if a scanned file was moved during the scan. (#72)
|
||||
* Clarified how directories' state are set by painting a combo box in the state cells. [Windows]
|
||||
(#76)
|
||||
* Fixed some crashes. (#78 and #79)
|
||||
* Dropped Mac OS X Tiger support.
|
||||
- date: 2009-10-24
|
||||
version: 1.7.8
|
||||
description: |
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os
|
||||
|
||||
import os.path as op
|
||||
from hsdocgen import generate_help, filters
|
||||
|
||||
def generate(windows=False):
|
||||
tix = filters.tixgen("https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}")
|
||||
|
||||
generate_help.main('.', 'dupeguru_pe_help', force_render=True, tix=tix)
|
||||
basepath = op.dirname(__file__)
|
||||
generate_help.main(basepath, op.join(basepath, 'dupeguru_pe_help'), force_render=True, tix=tix, windows=windows)
|
||||
|
||||
@@ -61,4 +61,14 @@ Enable the [Power Marker](power_marker.htm) mode and click on the Directory colu
|
||||
* **Windows**: Click on **Actions --> Apply Filter**, then type "copy", then click OK.
|
||||
* **Mac OS X**: Type "copy" in the "Filter" field in the toolbar.
|
||||
* Click on **Mark --> Mark All**.
|
||||
|
||||
### I tried to send my duplicates to Trash, but dupeGuru is telling me it can't do it. Why? What can I do?
|
||||
|
||||
Most of the time, the reason why dupeGuru can't send files to Trash is because of file permissions. You need *write* permissions on files you want to send to Trash. If you're not familiar with the command line, you can use utilities such as [BatChmod](http://macchampion.com/arbysoft/BatchMod) to fix your permissions.
|
||||
|
||||
If dupeGuru still gives you troubles after fixing your permissions, there have been some cases where using "Move Marked to..." as a workaround did the trick. So instead of sending your files to Trash, you send them to a temporary folder with the "Move Marked to..." action, and then you delete that temporary folder manually.
|
||||
|
||||
If you're trying to delete *iPhoto* pictures, then the reason for the failure is different. The deletion fails because dupeGuru can't communicate with iPhoto. Be aware that for the deletion to work correctly, you're not supposed to play around iPhoto while dupeGuru is working. Also, sometimes, the Applescript system doesn't seem to know where to find iPhoto to launch it. It might help in these cases to launch iPhoto *before* you send your duplicates to Trash.
|
||||
|
||||
If all of this fail, [contact HS support](http://www.hardcoded.net/support), we'll figure it out.
|
||||
</%text>
|
||||
@@ -14,7 +14,7 @@ import re
|
||||
|
||||
from Foundation import *
|
||||
from AppKit import *
|
||||
from appscript import app, k
|
||||
from appscript import app, k, CommandError
|
||||
|
||||
from hsutil import io
|
||||
from hsutil.str import get_file_ext
|
||||
@@ -66,6 +66,8 @@ class IPhoto(Photo):
|
||||
def get_iphoto_database_path():
|
||||
ud = NSUserDefaults.standardUserDefaults()
|
||||
prefs = ud.persistentDomainForName_('com.apple.iApps')
|
||||
if prefs is None:
|
||||
raise directories.InvalidPathError()
|
||||
if 'iPhotoRecentDatabases' not in prefs:
|
||||
raise directories.InvalidPathError()
|
||||
plisturl = NSURL.URLWithString_(prefs['iPhotoRecentDatabases'][0])
|
||||
@@ -96,11 +98,16 @@ def get_iphoto_pictures(plistpath):
|
||||
class Directories(directories.Directories):
|
||||
def __init__(self):
|
||||
directories.Directories.__init__(self, fileclasses=[Photo])
|
||||
try:
|
||||
self.iphoto_libpath = get_iphoto_database_path()
|
||||
self.set_state(self.iphoto_libpath[:-1], directories.STATE_EXCLUDED)
|
||||
except directories.InvalidPathError:
|
||||
self.iphoto_libpath = None
|
||||
|
||||
def _get_files(self, from_path):
|
||||
if from_path == Path('iPhoto Library'):
|
||||
if self.iphoto_libpath is None:
|
||||
return []
|
||||
is_ref = self.get_state(from_path) == directories.STATE_REFERENCE
|
||||
photos = get_iphoto_pictures(self.iphoto_libpath)
|
||||
for photo in photos:
|
||||
@@ -142,12 +149,18 @@ class DupeGuruPE(app_cocoa.DupeGuru):
|
||||
self.path2iphoto = {}
|
||||
if any(isinstance(dupe, IPhoto) for dupe in marked):
|
||||
j = j.start_subjob([6, 4], "Probing iPhoto. Don\'t touch it during the operation!")
|
||||
try:
|
||||
a = app('iPhoto')
|
||||
a.activate(timeout=0)
|
||||
a.select(a.photo_library_album(timeout=0), timeout=0)
|
||||
photos = as_fetch(a.photo_library_album().photos, k.item)
|
||||
for photo in j.iter_with_progress(photos):
|
||||
try:
|
||||
self.path2iphoto[unicode(photo.image_path(timeout=0))] = photo
|
||||
except CommandError:
|
||||
pass
|
||||
except (CommandError, RuntimeError):
|
||||
pass
|
||||
j.start_job(self.results.mark_count, "Sending dupes to the Trash")
|
||||
self.last_op_error_count = self.results.perform_on_marked(op, True)
|
||||
del self.path2iphoto
|
||||
@@ -156,11 +169,15 @@ class DupeGuruPE(app_cocoa.DupeGuru):
|
||||
if isinstance(dupe, IPhoto):
|
||||
if unicode(dupe.path) in self.path2iphoto:
|
||||
photo = self.path2iphoto[unicode(dupe.path)]
|
||||
try:
|
||||
a = app('iPhoto')
|
||||
a.remove(photo, timeout=0)
|
||||
return True
|
||||
except (CommandError, RuntimeError):
|
||||
return False
|
||||
else:
|
||||
logging.warning("Could not find photo {0} in iPhoto Library", unicode(dupe.path))
|
||||
logging.warning(u"Could not find photo %s in iPhoto Library", unicode(dupe.path))
|
||||
return False
|
||||
else:
|
||||
return app_cocoa.DupeGuru._do_delete_dupe(self, dupe)
|
||||
|
||||
@@ -170,7 +187,7 @@ class DupeGuruPE(app_cocoa.DupeGuru):
|
||||
|
||||
def _get_file(self, str_path):
|
||||
p = Path(str_path)
|
||||
if p in self.directories.iphoto_libpath[:-1]:
|
||||
if (self.directories.iphoto_libpath is not None) and (p in self.directories.iphoto_libpath[:-1]):
|
||||
return IPhoto(p)
|
||||
return app_cocoa.DupeGuru._get_file(self, str_path)
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
import logging
|
||||
|
||||
from PyQt4.QtGui import QImage
|
||||
import PIL.Image
|
||||
@@ -40,8 +41,12 @@ class File(fs.File):
|
||||
def _read_info(self, field):
|
||||
fs.File._read_info(self, field)
|
||||
if field == 'dimensions':
|
||||
try:
|
||||
im = PIL.Image.open(unicode(self.path))
|
||||
self.dimensions = im.size
|
||||
except IOError:
|
||||
self.dimensions = (0, 0)
|
||||
logging.warning(u"Could not read image '%s'", unicode(self.path))
|
||||
|
||||
def get_blocks(self, block_count_per_side):
|
||||
image = QImage(unicode(self.path))
|
||||
@@ -52,7 +57,7 @@ class File(fs.File):
|
||||
class DupeGuru(DupeGuruBase):
|
||||
LOGO_NAME = 'logo_pe'
|
||||
NAME = 'dupeGuru Picture Edition'
|
||||
VERSION = '1.7.7'
|
||||
VERSION = '1.8.0'
|
||||
DELTA_COLUMNS = frozenset([2, 5, 6])
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -13,10 +13,14 @@ import os.path as op
|
||||
|
||||
from hsutil.build import print_and_do, build_all_qt_ui
|
||||
|
||||
from help import gen
|
||||
|
||||
build_all_qt_ui(op.join('qtlib', 'ui'))
|
||||
build_all_qt_ui('base')
|
||||
build_all_qt_ui('.')
|
||||
print_and_do("pyrcc4 base\\dg.qrc > base\\dg_rc.py")
|
||||
os.chdir('base')
|
||||
print_and_do("pyrcc4 dg.qrc > dg_rc.py")
|
||||
os.chdir('..')
|
||||
|
||||
def move(src, dst):
|
||||
if not op.exists(src):
|
||||
@@ -39,5 +43,5 @@ move(op.join('modules', 'block', '_block.so'), op.join('.', '_block.so'))
|
||||
move(op.join('modules', 'block', '_block.pyd'), op.join('.', '_block.pyd'))
|
||||
|
||||
os.chdir('help')
|
||||
print_and_do('python gen.py')
|
||||
gen.generate(windows=True)
|
||||
os.chdir('..')
|
||||
@@ -11,6 +11,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
|
||||
import objc
|
||||
from AppKit import *
|
||||
|
||||
from hsutil import io
|
||||
@@ -25,6 +26,9 @@ 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)
|
||||
if error is not None:
|
||||
logging.warning(u'There was an error trying to detect the UTI of %s', str_path)
|
||||
|
||||
Reference in New Issue
Block a user