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

Compare commits

...

23 Commits

Author SHA1 Message Date
Virgil Dupras
f6806e42db se v2.12.3 2011-01-01 12:45:39 +01:00
Virgil Dupras
3aae21b810 Added tag pe1.11.3 for changeset 3f71a8f5bf8f 2010-12-31 15:51:52 +01:00
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
Virgil Dupras
7b0d3ea8ac me v5.10.4 2010-12-30 14:55:13 +01:00
Virgil Dupras
1c88b6bb26 Tweaked the wording of the fairware pop up. 2010-12-30 13:07:04 +01:00
Virgil Dupras
e5e8e5d908 Replaced the about box with one that supports fairware registering. 2010-12-30 13:00:44 +01:00
Virgil Dupras
92fadd26b7 [#120 state:fixed] Fixed dangling bogus results after cancelled scan. 2010-12-30 10:24:37 +01:00
Virgil Dupras
45d783ac43 Removed CallLogger-related code in app_test. This code was duplicating the code that was recently added to hscommon.testutil. 2010-12-30 10:00:29 +01:00
Virgil Dupras
ea9e76e7ae Removed conftest.py modules in tests, which aren't required anymore with pytest v2.0 2010-12-30 09:47:22 +01:00
Virgil Dupras
28426c0e91 [#121 state:fixed] Catch HTTPException in Fairware fetching. 2010-12-30 09:35:45 +01:00
Virgil Dupras
3a9f51b600 [#122 state:fixed] Fixed crash on scanning when file is being deleted during the scan. 2010-12-29 15:41:12 +01:00
Virgil Dupras
f1b4db368e [#123 state:fixed] Updated codebase to use hsaudiotag v1.1.0 (which fixed the AIFF bug) and made it use the new auto.File wrapper. 2010-12-29 13:17:30 +01:00
Virgil Dupras
95efac187b Updated hscommon and adapted to changes in hscommon.gui.table.Table.refresh(). 2010-11-24 16:12:10 +01:00
Virgil Dupras
6770d22438 Updated hscommon subrepo. 2010-11-22 10:06:42 +01:00
Virgil Dupras
4ce97613c4 Added tag me5.10.3 for changeset ca93352ce351 2010-11-21 17:56:37 +01:00
Virgil Dupras
030eb8eb6e Fixed debian packaging 2010-11-21 07:49:38 -08:00
Virgil Dupras
c9da8e26e6 Fixed crash caused by outdated hsgui. Also, fixed app_test, which was also outdated. 2010-11-21 16:45:02 +01:00
Virgil Dupras
7ddf9772df v5.10.3 2010-11-21 16:25:16 +01:00
Virgil Dupras
0382ad1534 Adapted to the job-related code moving to the 'jobprogress' package. 2010-11-20 12:42:15 +01:00
Virgil Dupras
1b6e1369a0 Tranformed PyQt's license warning into a licensing note
--HG--
rename : qt/WARNING => qt/ABOUT_LICENSE
2010-11-13 14:37:20 +01:00
Virgil Dupras
835050c337 Added tag pe1.11.2 for changeset 154c8cb6f018 2010-10-07 12:44:04 +02:00
42 changed files with 232 additions and 409 deletions

View File

@@ -35,3 +35,7 @@ b07ac1398703dd358912c1f3d20bd995633db9fe pe1.11.0
96b6aee668398d663b04eafc8d5dae05e18500ee before-fairware
22239f94589baf2a9fad2123045b8a718dbd68f5 se2.12.2
f9cae82a0752191276b24ffb2cc4e4a8afb5d754 me5.10.2
154c8cb6f018d446d88fa099490c900906e86386 pe1.11.2
ca93352ce35184853ad9fcb881935a43a8b1e249 me5.10.3
44f6ff67066c083f79daa18a9d2f1ab909e0a62e me5.10.4
3f71a8f5bf8f6d0729748a27af9163e013723294 pe1.11.3

11
README
View File

@@ -25,12 +25,13 @@ General dependencies
-----
- Python 3.1 (http://www.python.org)
- Send2Trash3k (http://hg.hardcoded.net/send2trash3k)
- hsutil3k (http://hg.hardcoded.net/hsutil3k)
- hsaudiotag3k (for ME) (http://hg.hardcoded.net/hsaudiotag3k)
- Send2Trash3k (http://hg.hardcoded.net/send2trash)
- hsutil3k (http://hg.hardcoded.net/hsutil)
- hsaudiotag3k 1.1.0 (for ME) (http://hg.hardcoded.net/hsaudiotag)
- jobprogress (http://hg.hardcoded.net/jobprogress)
- Markdown, to generate help files. (http://pypi.python.org/pypi/Markdown)
- PyYaml, for help files and the build system. (http://pyyaml.org/)
- py.test, to run unit tests. (http://codespeak.net/py/dist/test/)
- pytest 2.0.0, to run unit tests. (http://pytest.org/)
OS X prerequisites
-----
@@ -38,7 +39,7 @@ OS X prerequisites
- XCode 3.1 (http://developer.apple.com/TOOLS/xcode/)
- Sparkle (http://sparkle.andymatuschak.org/)
- PyObjC 2.3. (http://pyobjc.sourceforge.net/)
- py2app 0.5.4 (http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html)
- py2app 0.5.4 (http://bitbucket.org/ronaldoussoren/py2app)
Windows prerequisites
---

View File

@@ -12,6 +12,7 @@ http://www.hardcoded.net/licenses/bsd_license
#import "ResultWindow.h"
#import "DetailsPanel.h"
#import "DirectoryPanel.h"
#import "HSAboutBox.h"
@interface AppDelegateBase : NSObject
{
@@ -21,6 +22,7 @@ http://www.hardcoded.net/licenses/bsd_license
DirectoryPanel *_directoryPanel;
DetailsPanel *_detailsPanel;
HSAboutBox *_aboutBox;
BOOL _savedResults;
}
- (PyDupeGuruBase *)py;
@@ -28,4 +30,6 @@ http://www.hardcoded.net/licenses/bsd_license
- (DirectoryPanel *)directoryPanel;
- (DetailsPanel *)detailsPanel;
- (void)saveResults;
- (IBAction)showAboutBox:(id)sender;
@end

View File

@@ -40,6 +40,14 @@ http://www.hardcoded.net/licenses/bsd_license
_savedResults = YES;
}
- (IBAction)showAboutBox:(id)sender
{
if (_aboutBox == nil) {
_aboutBox = [[HSAboutBox alloc] initWithApp:py];
}
[[_aboutBox window] makeKeyAndOrderFront:sender];
}
/* Delegate */
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

View File

@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10F569</string>
<string key="IBDocument.InterfaceBuilderVersion">788</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.SystemVersion">10H574</string>
<string key="IBDocument.InterfaceBuilderVersion">823</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">788</string>
<string key="NS.object.0">823</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -20,13 +20,8 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="248533267">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -83,11 +78,9 @@
<string key="NSToolbarItemPaletteLabel">Power Marker</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSegmentedControl" key="NSToolbarItemView" id="35398541">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{7, 14}, {67, 25}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="431579725">
<int key="NSCellFlags">67239424</int>
@@ -179,11 +172,9 @@
<string key="NSToolbarItemPaletteLabel">Filter</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSearchField" key="NSToolbarItemView" id="1013657232">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">258</int>
<string key="NSFrame">{{0, 14}, {81, 22}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSearchFieldCell" key="NSCell" id="484816507">
<int key="NSCellFlags">343014976</int>
@@ -325,11 +316,9 @@
<string key="NSToolbarItemPaletteLabel">Action</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSPopUpButton" key="NSToolbarItemView" id="165812138">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{1, 14}, {40, 25}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="436420677">
<int key="NSCellFlags">-2076049856</int>
@@ -541,11 +530,9 @@
<string key="NSToolbarItemPaletteLabel">Delta Values</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSegmentedControl" key="NSToolbarItemView" id="311230297">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{4, 14}, {67, 25}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="211272396">
<int key="NSCellFlags">67239424</int>
@@ -688,7 +675,9 @@
<reference ref="729141644"/>
<reference ref="764949265"/>
</object>
<reference key="NSToolbarIBSelectableItems" ref="0"/>
<object class="NSArray" key="NSToolbarIBSelectableItems" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{340, 340}</string>
@@ -1652,14 +1641,6 @@
</object>
<int key="connectionID">139</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">orderFrontStandardAboutPanel:</string>
<reference key="source" ref="77446904"/>
<reference key="destination" ref="436112936"/>
</object>
<int key="connectionID">142</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">hideOtherApplications:</string>
@@ -2284,6 +2265,14 @@
</object>
<int key="connectionID">1231</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showAboutBox:</string>
<reference key="source" ref="91622651"/>
<reference key="destination" ref="436112936"/>
</object>
<int key="connectionID">1232</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -3689,7 +3678,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">1231</int>
<int key="maxID">1232</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3795,6 +3784,17 @@
<object class="IBPartialClassDescription">
<string key="className">AppDelegateBase</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">showAboutBox:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">showAboutBox:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">showAboutBox:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
@@ -3887,7 +3887,7 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">PyApp</string>
<string key="superclassName">PyRegistrable</string>
<string key="superclassName">PyFairware</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../PyApp.h</string>
@@ -3895,7 +3895,7 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">PyApp</string>
<string key="superclassName">PyRegistrable</string>
<string key="superclassName">PyFairware</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
@@ -3925,6 +3925,14 @@
<string key="minorKey">../base/PyDupeGuru.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">PyFairware</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../PyFairware.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">RecentDirectories</string>
<string key="superclassName">NSObject</string>

View File

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

View File

@@ -43,6 +43,8 @@
CE49DEF60FDFEB810098617B /* BRSingleLineFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = CE49DEF30FDFEB810098617B /* BRSingleLineFormatter.m */; };
CE4B59C81119919700C06C9E /* ErrorReportWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE4B59C51119919700C06C9E /* ErrorReportWindow.xib */; };
CE4B59C91119919700C06C9E /* progress.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE4B59C61119919700C06C9E /* progress.xib */; };
CE4F934612CCA9470067A3AE /* about.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE4F934512CCA9470067A3AE /* about.xib */; };
CE4F934912CCA96C0067A3AE /* HSAboutBox.m in Sources */ = {isa = PBXBuildFile; fileRef = CE4F934812CCA96C0067A3AE /* HSAboutBox.m */; };
CE515DF30FC6C12E00EC695D /* Dialogs.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DE10FC6C12E00EC695D /* Dialogs.m */; };
CE515DF40FC6C12E00EC695D /* HSErrorReportWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DE30FC6C12E00EC695D /* HSErrorReportWindow.m */; };
CE515DF60FC6C12E00EC695D /* ProgressController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DE70FC6C12E00EC695D /* ProgressController.m */; };
@@ -130,6 +132,9 @@
CE49DEF30FDFEB810098617B /* BRSingleLineFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BRSingleLineFormatter.m; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.m; sourceTree = SOURCE_ROOT; };
CE4B59C51119919700C06C9E /* ErrorReportWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ErrorReportWindow.xib; sourceTree = "<group>"; };
CE4B59C61119919700C06C9E /* progress.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = progress.xib; sourceTree = "<group>"; };
CE4F934512CCA9470067A3AE /* about.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = about.xib; path = ../../cocoalib/xib/about.xib; sourceTree = SOURCE_ROOT; };
CE4F934712CCA96C0067A3AE /* HSAboutBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSAboutBox.h; path = ../../cocoalib/HSAboutBox.h; sourceTree = SOURCE_ROOT; };
CE4F934812CCA96C0067A3AE /* HSAboutBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSAboutBox.m; path = ../../cocoalib/HSAboutBox.m; sourceTree = SOURCE_ROOT; };
CE515DE00FC6C12E00EC695D /* Dialogs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Dialogs.h; path = ../../cocoalib/Dialogs.h; sourceTree = SOURCE_ROOT; };
CE515DE10FC6C12E00EC695D /* Dialogs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Dialogs.m; path = ../../cocoalib/Dialogs.m; sourceTree = SOURCE_ROOT; };
CE515DE20FC6C12E00EC695D /* HSErrorReportWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSErrorReportWindow.h; path = ../../cocoalib/HSErrorReportWindow.h; sourceTree = SOURCE_ROOT; };
@@ -347,6 +352,7 @@
CE4B59C41119919700C06C9E /* xib */ = {
isa = PBXGroup;
children = (
CE4F934512CCA9470067A3AE /* about.xib */,
CE74A12512537F2E008A8DF0 /* FairwareReminder.xib */,
CE4B59C51119919700C06C9E /* ErrorReportWindow.xib */,
CE4B59C61119919700C06C9E /* progress.xib */,
@@ -370,6 +376,8 @@
CE74A12112537F06008A8DF0 /* HSFairwareReminder.h */,
CE74A12212537F06008A8DF0 /* HSFairwareReminder.m */,
CE74A12312537F06008A8DF0 /* PyFairware.h */,
CE4F934712CCA96C0067A3AE /* HSAboutBox.h */,
CE4F934812CCA96C0067A3AE /* HSAboutBox.m */,
CE003CB911242D00004B0AA7 /* NSEventAdditions.h */,
CE003CBA11242D00004B0AA7 /* NSEventAdditions.m */,
CE515DE60FC6C12E00EC695D /* ProgressController.h */,
@@ -455,6 +463,7 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "dupeguru" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -492,6 +501,7 @@
CE4B59C91119919700C06C9E /* progress.xib in Resources */,
CE0A0C061175A24800DCA3C6 /* ProblemDialog.xib in Resources */,
CE74A12712537F2E008A8DF0 /* FairwareReminder.xib in Resources */,
CE4F934612CCA9470067A3AE /* about.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -531,6 +541,7 @@
CEB14D29124DFC2800FA7481 /* ResultTable.m in Sources */,
CE578303124DFC660004769C /* HSTableView.m in Sources */,
CE74A12412537F06008A8DF0 /* HSFairwareReminder.m in Sources */,
CE4F934912CCA96C0067A3AE /* HSAboutBox.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -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>

View File

@@ -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

View File

@@ -51,6 +51,8 @@
CE9EA75C1122C96C008CD2BC /* NSTableViewAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7551122C96C008CD2BC /* NSTableViewAdditions.m */; };
CE9EA7721122CA0B008CD2BC /* DirectoryOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7701122CA0B008CD2BC /* DirectoryOutline.m */; };
CEBAE4270FDA97E000B7887D /* BRSingleLineFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBAE4240FDA97E000B7887D /* BRSingleLineFormatter.m */; };
CEC9DB4712CCAA6B003102F0 /* about.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEC9DB4612CCAA6B003102F0 /* about.xib */; };
CEC9DB4C12CCAA7D003102F0 /* HSAboutBox.m in Sources */ = {isa = PBXBuildFile; fileRef = CEC9DB4B12CCAA7D003102F0 /* HSAboutBox.m */; };
CECA899C09DB132E00A3D774 /* DetailsPanel.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECA899A09DB132E00A3D774 /* DetailsPanel.h */; };
CECA899D09DB132E00A3D774 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CECA899B09DB132E00A3D774 /* DetailsPanel.m */; };
CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; };
@@ -165,6 +167,9 @@
CE9EA7711122CA0B008CD2BC /* PyDirectoryOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyDirectoryOutline.h; path = ../base/PyDirectoryOutline.h; sourceTree = SOURCE_ROOT; };
CEBAE4230FDA97E000B7887D /* BRSingleLineFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BRSingleLineFormatter.h; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.h; sourceTree = SOURCE_ROOT; };
CEBAE4240FDA97E000B7887D /* BRSingleLineFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BRSingleLineFormatter.m; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.m; sourceTree = SOURCE_ROOT; };
CEC9DB4612CCAA6B003102F0 /* about.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = about.xib; path = ../../cocoalib/xib/about.xib; sourceTree = SOURCE_ROOT; };
CEC9DB4A12CCAA7D003102F0 /* HSAboutBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSAboutBox.h; path = ../../cocoalib/HSAboutBox.h; sourceTree = SOURCE_ROOT; };
CEC9DB4B12CCAA7D003102F0 /* HSAboutBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSAboutBox.m; path = ../../cocoalib/HSAboutBox.m; sourceTree = SOURCE_ROOT; };
CECA899A09DB132E00A3D774 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = DetailsPanel.h; sourceTree = "<group>"; };
CECA899B09DB132E00A3D774 /* DetailsPanel.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = DetailsPanel.m; sourceTree = "<group>"; };
CEEB135109C837A2004D2330 /* dupeguru.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = dupeguru.icns; sourceTree = "<group>"; };
@@ -297,6 +302,7 @@
CE7AC9141119911200D02F6C /* xib */ = {
isa = PBXGroup;
children = (
CEC9DB4612CCAA6B003102F0 /* about.xib */,
CE1EB5FF12537FB90034AABB /* FairwareReminder.xib */,
CE7AC9151119911200D02F6C /* ErrorReportWindow.xib */,
CE7AC9161119911200D02F6C /* progress.xib */,
@@ -326,6 +332,8 @@
CE1EB5FB12537F9D0034AABB /* HSFairwareReminder.h */,
CE1EB5FC12537F9D0034AABB /* HSFairwareReminder.m */,
CE1EB5FD12537F9D0034AABB /* PyFairware.h */,
CEC9DB4A12CCAA7D003102F0 /* HSAboutBox.h */,
CEC9DB4B12CCAA7D003102F0 /* HSAboutBox.m */,
CE80DB210FC192D60086DCA6 /* ProgressController.h */,
CE80DB220FC192D60086DCA6 /* ProgressController.m */,
CE80DB230FC192D60086DCA6 /* PyApp.h */,
@@ -462,6 +470,7 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "dupeguru" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -500,6 +509,7 @@
CE7AC9191119911200D02F6C /* progress.xib in Resources */,
CE0C2AC81177021600BC749F /* ProblemDialog.xib in Resources */,
CE1EB60112537FB90034AABB /* FairwareReminder.xib in Resources */,
CEC9DB4712CCAA6B003102F0 /* about.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -542,6 +552,7 @@
CEF12A7E124DFD400087B51D /* HSTableView.m in Sources */,
CEF12A84124DFD620087B51D /* ResultTable.m in Sources */,
CE1EB5FE12537F9D0034AABB /* HSFairwareReminder.m in Sources */,
CEC9DB4C12CCAA7D003102F0 /* HSAboutBox.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

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

View File

@@ -12,6 +12,8 @@
CE073F6309CAE1A3005C1D2F /* dupeguru_help in Resources */ = {isa = PBXBuildFile; fileRef = CE073F5409CAE1A3005C1D2F /* dupeguru_help */; };
CE19BC6311199231007CCEB0 /* ErrorReportWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE19BC6011199231007CCEB0 /* ErrorReportWindow.xib */; };
CE19BC6411199231007CCEB0 /* progress.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE19BC6111199231007CCEB0 /* progress.xib */; };
CE27D3C112CCA42500859E67 /* about.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE27D3C012CCA42500859E67 /* about.xib */; };
CE27D3C412CCA43800859E67 /* HSAboutBox.m in Sources */ = {isa = PBXBuildFile; fileRef = CE27D3C312CCA43800859E67 /* HSAboutBox.m */; };
CE381C9609914ACE003581CE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9409914ACE003581CE /* AppDelegate.m */; };
CE381C9C09914ADF003581CE /* ResultWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9A09914ADF003581CE /* ResultWindow.m */; };
CE381D0509915304003581CE /* dg_cocoa.plugin in Resources */ = {isa = PBXBuildFile; fileRef = CE381CF509915304003581CE /* dg_cocoa.plugin */; };
@@ -79,6 +81,9 @@
CE073F5409CAE1A3005C1D2F /* dupeguru_help */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dupeguru_help; path = ../../help_se/dupeguru_help; sourceTree = "<group>"; };
CE19BC6011199231007CCEB0 /* ErrorReportWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ErrorReportWindow.xib; sourceTree = "<group>"; };
CE19BC6111199231007CCEB0 /* progress.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = progress.xib; sourceTree = "<group>"; };
CE27D3C012CCA42500859E67 /* about.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = about.xib; path = ../../cocoalib/xib/about.xib; sourceTree = SOURCE_ROOT; };
CE27D3C212CCA43800859E67 /* HSAboutBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSAboutBox.h; path = ../../cocoalib/HSAboutBox.h; sourceTree = SOURCE_ROOT; };
CE27D3C312CCA43800859E67 /* HSAboutBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSAboutBox.m; path = ../../cocoalib/HSAboutBox.m; sourceTree = SOURCE_ROOT; };
CE381C9409914ACE003581CE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
CE381C9509914ACE003581CE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
CE381C9A09914ADF003581CE /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = ResultWindow.m; sourceTree = SOURCE_ROOT; };
@@ -252,6 +257,7 @@
CE19BC5F11199231007CCEB0 /* xib */ = {
isa = PBXGroup;
children = (
CE27D3C012CCA42500859E67 /* about.xib */,
CE79638412536C94008D405B /* FairwareReminder.xib */,
CE19BC6011199231007CCEB0 /* ErrorReportWindow.xib */,
CE19BC6111199231007CCEB0 /* progress.xib */,
@@ -351,6 +357,8 @@
CE79638A12536F4E008D405B /* HSFairwareReminder.h */,
CE79638B12536F4E008D405B /* HSFairwareReminder.m */,
CE79638212536C6E008D405B /* PyFairware.h */,
CE27D3C212CCA43800859E67 /* HSAboutBox.h */,
CE27D3C312CCA43800859E67 /* HSAboutBox.m */,
CEFC7F900FC9517500CD5728 /* ProgressController.h */,
CEFC7F910FC9517500CD5728 /* ProgressController.m */,
CEFC7F920FC9517500CD5728 /* PyApp.h */,
@@ -426,6 +434,7 @@
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "dupeguru" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -463,6 +472,7 @@
CE19BC6411199231007CCEB0 /* progress.xib in Resources */,
CE647E591173026F006D28BA /* ProblemDialog.xib in Resources */,
CE79638612536C94008D405B /* FairwareReminder.xib in Resources */,
CE27D3C112CCA42500859E67 /* about.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -501,6 +511,7 @@
CE6DD4E7124CA3070089A48D /* ResultTable.m in Sources */,
CE6DD547124CAF1F0089A48D /* HSTableView.m in Sources */,
CE79638C12536F4E008D405B /* HSFairwareReminder.m in Sources */,
CE27D3C412CCA43800859E67 /* HSAboutBox.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -113,7 +113,11 @@ class DupeGuru(RegistrableApplication, Broadcaster):
seen_inodes = set()
result = []
for file in files:
inode = io.stat(file.path).st_ino
try:
inode = io.stat(file.path).st_ino
except OSError:
# The file was probably deleted or something
continue
if inode not in seen_inodes:
seen_inodes.add(inode)
result.append(file)
@@ -349,6 +353,7 @@ class DupeGuru(RegistrableApplication, Broadcaster):
if not self.directories.has_any_file():
raise NoScannableFileError()
self.results.groups = []
self.notify('results_changed')
self._start_job(JOB_SCAN, do)
def toggle_selected_mark_state(self):

View File

@@ -9,7 +9,8 @@
import logging
import os.path as op
from hscommon import cocoa, job
from jobprogress import job
from hscommon import cocoa
from hscommon.cocoa import install_exception_hook
from hscommon.cocoa.objcmin import (NSNotificationCenter, NSUserDefaults,
NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSUserDomainMask,

View File

@@ -16,7 +16,7 @@ from unicodedata import normalize
from hsutil.misc import flatten
from hsutil.str import multi_replace
from hscommon import job
from jobprogress import job
(WEIGHT_WORDS,
MATCH_SIMILAR_WORDS,

View File

@@ -7,7 +7,7 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from hsgui.tree import Tree, Node
from hscommon.gui.tree import Tree, Node
from ..directories import STATE_NORMAL, STATE_REFERENCE, STATE_EXCLUDED
from .base import GUIObject

View File

@@ -8,7 +8,7 @@
# http://www.hardcoded.net/licenses/bsd_license
from hscommon.notify import Listener
from hsgui.table import GUITable, Row
from hscommon.gui.table import GUITable, Row
class ProblemTable(GUITable, Listener):
def __init__(self, view, problem_dialog):
@@ -31,7 +31,6 @@ class ProblemTable(GUITable, Listener):
#--- Event handlers
def problems_changed(self):
self.refresh()
self.view.refresh()
class ProblemRow(Row):

View File

@@ -9,7 +9,7 @@
from operator import attrgetter
from hsgui.table import GUITable, Row
from hscommon.gui.table import GUITable, Row
from .base import GUIObject
@@ -87,7 +87,6 @@ class ResultTable(GUIObject, GUITable):
def _refresh_with_view(self):
self.refresh()
self.view.refresh()
self.view.show_selected_row()
#--- Public
@@ -139,7 +138,6 @@ class ResultTable(GUIObject, GUITable):
return
self._delta_values = value
self.refresh()
self.view.refresh()
@property
def selected_dupe_count(self):
@@ -156,7 +154,7 @@ class ResultTable(GUIObject, GUITable):
# What we want to to here is that instead of restoring selected *dupes* after refresh, we
# restore selected *paths*.
indexes = self.selected_indexes
self.refresh()
self.refresh(refresh_view=False)
self.select(indexes)
self.view.refresh()

View File

@@ -11,7 +11,7 @@ import re
from xml.etree import ElementTree as ET
from . import engine
from hscommon.job import nulljob
from jobprogress.job import nulljob
from hscommon.markable import Markable
from hsutil.misc import flatten, nonone
from hsutil.str import format_size

View File

@@ -9,7 +9,7 @@
import logging
import re
from hscommon import job
from jobprogress import job
from hsutil import io
from hsutil.misc import dedupe
from hsutil.str import get_file_ext, rem_file_ext

View File

@@ -15,7 +15,8 @@ from hsutil import io
from hsutil.path import Path
from hsutil.decorators import log_calls
import hsutil.files
from hscommon.job import nulljob
from hscommon.testutil import CallLogger
from jobprogress.job import nulljob, Job, JobCancelled
from . import data
from .results_test import GetTestGroups
@@ -27,29 +28,21 @@ from ..gui.result_table import ResultTable
from ..scanner import ScanType
class DupeGuru(DupeGuruBase):
JOB = nulljob
def __init__(self):
DupeGuruBase.__init__(self, data, '/tmp', appid=4)
DupeGuruBase.__init__(self, data, '/tmp')
def _start_job(self, jobid, func, *args):
func(nulljob, *args)
try:
func(self.JOB, *args)
except JobCancelled:
return
class CallLogger(object):
"""This is a dummy object that logs all calls made to it.
It is used to simulate the GUI layer.
"""
def __init__(self):
self.calls = []
def __getattr__(self, func_name):
def func(*args, **kw):
self.calls.append(func_name)
return func
def clear_calls(self):
del self.calls[:]
def add_fake_files_to_directories(directories, files):
directories.get_files = lambda: iter(files)
directories._dirs.append('this is just so Scan() doesnt return 3')
class TCDupeGuru(TestCase):
cls_tested_module = app
@@ -119,8 +112,7 @@ class TCDupeGuru(TestCase):
f1, f2 = [FakeFile('foo') for i in range(2)]
f1.is_ref, f2.is_ref = (False, False)
assert not (bool(f1) and bool(f2))
app.directories.get_files = lambda: iter([f1, f2])
app.directories._dirs.append('this is just so Scan() doesnt return 3')
add_fake_files_to_directories(app.directories, [f1, f2])
app.start_scanning() # no exception
def test_ignore_hardlink_matches(self):
@@ -190,44 +182,6 @@ class TCDupeGuruWithResults(TestCase):
io.mkdir(tmppath + 'bar')
self.app.directories.add_path(tmppath)
def check_gui_calls(self, gui, expected, verify_order=False):
"""Checks that the expected calls have been made to 'gui', then clears the log.
`expected` is an iterable of strings representing method names.
If `verify_order` is True, the order of the calls matters.
"""
if verify_order:
eq_(gui.calls, expected)
else:
eq_(set(gui.calls), set(expected))
gui.clear_calls()
def check_gui_calls_partial(self, gui, expected=None, not_expected=None):
"""Checks that the expected calls have been made to 'gui', then clears the log.
`expected` is an iterable of strings representing method names. Order doesn't matter.
Moreover, if calls have been made that are not in expected, no failure occur.
`not_expected` can be used for a more explicit check (rather than calling `check_gui_calls`
with an empty `expected`) to assert that calls have *not* been made.
"""
calls = set(gui.calls)
if expected is not None:
expected = set(expected)
not_called = expected - calls
assert not not_called, "These calls haven't been made: {0}".format(not_called)
if not_expected is not None:
not_expected = set(not_expected)
called = not_expected & calls
assert not called, "These calls shouldn't have been made: {0}".format(called)
gui.clear_calls()
def clear_gui_calls(self):
for attr in dir(self):
if attr.endswith('_gui'):
gui = getattr(self, attr)
if hasattr(gui, 'calls'): # We might have test methods ending with '_gui'
gui.clear_calls()
def test_GetObjects(self):
objects = self.objects
groups = self.groups
@@ -287,8 +241,6 @@ class TCDupeGuruWithResults(TestCase):
def test_selected_powermarker_node_paths(self):
# app.selected_dupes is correctly converted into paths
app = self.app
objects = self.objects
self.rtable.power_marker = True
self.rtable.select([0, 1, 2])
self.rtable.power_marker = False
@@ -297,7 +249,6 @@ class TCDupeGuruWithResults(TestCase):
def test_selected_powermarker_node_paths_after_deletion(self):
# cases where the selected dupes aren't there are correctly handled
app = self.app
objects = self.objects
self.rtable.power_marker = True
self.rtable.select([0, 1, 2])
app.remove_selected()
@@ -331,10 +282,10 @@ class TCDupeGuruWithResults(TestCase):
def test_refreshDetailsWithSelected(self):
self.rtable.select([1, 4])
eq_(self.dpanel.row(0), ('Filename', 'bar bleh', 'foo bar'))
self.check_gui_calls(self.dpanel_gui, ['refresh'])
self.dpanel_gui.check_gui_calls(['refresh'])
self.rtable.select([])
eq_(self.dpanel.row(0), ('Filename', '---', '---'))
self.check_gui_calls(self.dpanel_gui, ['refresh'])
self.dpanel_gui.check_gui_calls(['refresh'])
def test_makeSelectedReference(self):
app = self.app
@@ -413,6 +364,14 @@ class TCDupeGuruWithResults(TestCase):
self.rtable.select([4])
app.add_selected_to_ignore_list()
def test_cancel_scan_with_previous_results(self):
# When doing a scan with results being present prior to the scan, correctly invalidate the
# results table.
app = self.app
app.JOB = Job(1, lambda *args, **kw: False) # Cancels the task
add_fake_files_to_directories(app.directories, self.objects) # We want the scan to at least start
app.start_scanning() # will be cancelled immediately
eq_(len(self.rtable), 0)
class TCDupeGuru_renameSelected(TestCase):
def setUp(self):

View File

@@ -1,28 +0,0 @@
# -*- coding: utf-8 -*-
# Created By: Virgil Dupras
# Created On: 2010-07-11
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
# This unit is required to make tests work with py.test. When running
import py
def get_testunit(item):
if hasattr(item, 'obj'):
testunit = py.builtin._getimself(item.obj)
if hasattr(testunit, 'global_setup'):
return testunit
def pytest_runtest_setup(item):
testunit = get_testunit(item)
if testunit is not None:
testunit.global_setup()
def pytest_runtest_teardown(item):
testunit = get_testunit(item)
if testunit is not None:
testunit.global_teardown()

View File

@@ -8,7 +8,7 @@
import sys
from hscommon import job
from jobprogress import job
from hsutil.decorators import log_calls
from hsutil.misc import first
from hsutil.testutil import eq_

View File

@@ -6,8 +6,7 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from hscommon import job
from jobprogress import job
from hsutil import io
from hsutil.path import Path
from hsutil.testutil import eq_

View File

@@ -28,7 +28,7 @@ class DupeGuruME(DupeGuruBase):
def __init__(self):
DupeGuruBase.__init__(self, data, 'dupeGuru Music Edition')
self.scanner = scanner.ScannerME()
self.directories.fileclasses = [fs.Mp3File, fs.Mp4File, fs.WmaFile, fs.OggFile, fs.FlacFile, fs.AiffFile]
self.directories.fileclasses = [fs.MusicFile]
self.dead_tracks = []
def remove_dead_tracks(self):

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Created By: Virgil Dupras
# Created On: 2009-10-23
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
@@ -7,12 +6,12 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from hsaudiotag import mpeg, wma, mp4, ogg, flac, aiff
from hsaudiotag import auto
from hsutil.str import get_file_ext
from core import fs
TAG_FIELDS = ['audiosize', 'duration', 'bitrate', 'samplerate', 'title', 'artist',
'album', 'genre', 'year', 'track', 'comment']
TAG_FIELDS = {'audiosize', 'duration', 'bitrate', 'samplerate', 'title', 'artist',
'album', 'genre', 'year', 'track', 'comment'}
class MusicFile(fs.File):
INITIAL_INFO = fs.File.INITIAL_INFO.copy()
@@ -29,154 +28,30 @@ class MusicFile(fs.File):
'year' : '',
'track' : 0,
})
HANDLED_EXTS = set()
@classmethod
def can_handle(cls, path):
if not fs.File.can_handle(path):
return False
return get_file_ext(path[-1]) in cls.HANDLED_EXTS
return get_file_ext(path[-1]) in auto.EXT2CLASS
class Mp3File(MusicFile):
HANDLED_EXTS = set(['mp3'])
def _read_info(self, field):
if field == 'md5partial':
fileinfo = mpeg.Mpeg(str(self.path))
self._md5partial_offset = fileinfo.audio_offset
self._md5partial_size = fileinfo.audio_size
MusicFile._read_info(self, field)
f = auto.File(str(self.path))
self._md5partial_offset = f.audio_offset
self._md5partial_size = f.audio_size
fs.File._read_info(self, field)
if field in TAG_FIELDS:
fileinfo = mpeg.Mpeg(str(self.path))
self.audiosize = fileinfo.audio_size
self.bitrate = fileinfo.bitrate
self.duration = fileinfo.duration
self.samplerate = fileinfo.sample_rate
i1 = fileinfo.id3v1
# id3v1, even when non-existant, gives empty values. not id3v2. if id3v2 don't exist,
# just replace it with id3v1
i2 = fileinfo.id3v2
if not i2.exists:
i2 = i1
self.artist = i2.artist or i1.artist
self.album = i2.album or i1.album
self.title = i2.title or i1.title
self.genre = i2.genre or i1.genre
self.comment = i2.comment or i1.comment
self.year = i2.year or i1.year
self.track = i2.track or i1.track
class WmaFile(MusicFile):
HANDLED_EXTS = set(['wma'])
def _read_info(self, field):
if field == 'md5partial':
dec = wma.WMADecoder(str(self.path))
self._md5partial_offset = dec.audio_offset
self._md5partial_size = dec.audio_size
MusicFile._read_info(self, field)
if field in TAG_FIELDS:
dec = wma.WMADecoder(str(self.path))
self.audiosize = dec.audio_size
self.bitrate = dec.bitrate
self.duration = dec.duration
self.samplerate = dec.sample_rate
self.artist = dec.artist
self.album = dec.album
self.title = dec.title
self.genre = dec.genre
self.comment = dec.comment
self.year = dec.year
self.track = dec.track
class Mp4File(MusicFile):
HANDLED_EXTS = set(['m4a', 'm4p'])
def _read_info(self, field):
if field == 'md5partial':
dec = mp4.File(str(self.path))
self._md5partial_offset = dec.audio_offset
self._md5partial_size = dec.audio_size
dec.close()
MusicFile._read_info(self, field)
if field in TAG_FIELDS:
dec = mp4.File(str(self.path))
self.audiosize = dec.audio_size
self.bitrate = dec.bitrate
self.duration = dec.duration
self.samplerate = dec.sample_rate
self.artist = dec.artist
self.album = dec.album
self.title = dec.title
self.genre = dec.genre
self.comment = dec.comment
self.year = dec.year
self.track = dec.track
dec.close()
class OggFile(MusicFile):
HANDLED_EXTS = set(['ogg'])
def _read_info(self, field):
if field == 'md5partial':
dec = ogg.Vorbis(str(self.path))
self._md5partial_offset = dec.audio_offset
self._md5partial_size = dec.audio_size
MusicFile._read_info(self, field)
if field in TAG_FIELDS:
dec = ogg.Vorbis(str(self.path))
self.audiosize = dec.audio_size
self.bitrate = dec.bitrate
self.duration = dec.duration
self.samplerate = dec.sample_rate
self.artist = dec.artist
self.album = dec.album
self.title = dec.title
self.genre = dec.genre
self.comment = dec.comment
self.year = dec.year
self.track = dec.track
class FlacFile(MusicFile):
HANDLED_EXTS = set(['flac'])
def _read_info(self, field):
if field == 'md5partial':
dec = flac.FLAC(str(self.path))
self._md5partial_offset = dec.audio_offset
self._md5partial_size = dec.audio_size
MusicFile._read_info(self, field)
if field in TAG_FIELDS:
dec = flac.FLAC(str(self.path))
self.audiosize = dec.audio_size
self.bitrate = dec.bitrate
self.duration = dec.duration
self.samplerate = dec.sample_rate
self.artist = dec.artist
self.album = dec.album
self.title = dec.title
self.genre = dec.genre
self.comment = dec.comment
self.year = dec.year
self.track = dec.track
class AiffFile(MusicFile):
HANDLED_EXTS = set(['aif', 'aiff', 'aifc'])
def _read_info(self, field):
if field == 'md5partial':
dec = aiff.File(str(self.path))
self._md5partial_offset = dec.audio_offset
self._md5partial_size = dec.audio_size
MusicFile._read_info(self, field)
if field in TAG_FIELDS:
dec = aiff.File(str(self.path))
self.audiosize = dec.audio_size
self.bitrate = dec.bitrate
self.duration = dec.duration
self.samplerate = dec.sample_rate
tag = dec.tag
if tag is not None:
self.artist = tag.artist
self.album = tag.album
self.title = tag.title
self.genre = tag.genre
self.comment = tag.comment
self.year = tag.year
self.track = tag.track
f = auto.File(str(self.path))
self.audiosize = f.audio_size
self.bitrate = f.bitrate
self.duration = f.duration
self.samplerate = f.sample_rate
self.artist = f.artist
self.album = f.album
self.title = f.title
self.genre = f.genre
self.comment = f.comment
self.year = f.year
self.track = f.track

View File

@@ -1,28 +0,0 @@
# -*- coding: utf-8 -*-
# Created By: Virgil Dupras
# Created On: 2010-07-11
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
# This unit is required to make tests work with py.test. When running
import py
def get_testunit(item):
if hasattr(item, 'obj'):
testunit = py.builtin._getimself(item.obj)
if hasattr(testunit, 'global_setup'):
return testunit
def pytest_runtest_setup(item):
testunit = get_testunit(item)
if testunit is not None:
testunit.global_setup()
def pytest_runtest_teardown(item):
testunit = get_testunit(item)
if testunit is not None:
testunit.global_teardown()

View File

@@ -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

View File

@@ -10,7 +10,7 @@ import logging
import multiprocessing
from collections import defaultdict, deque
from hscommon import job
from jobprogress import job
from core.engine import Match
from .block import avgdiff, DifferentBlockCountError, NoBlocksError

View File

@@ -1,28 +0,0 @@
# -*- coding: utf-8 -*-
# Created By: Virgil Dupras
# Created On: 2010-07-11
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
# This unit is required to make tests work with py.test. When running
import py
def get_testunit(item):
if hasattr(item, 'obj'):
testunit = py.builtin._getimself(item.obj)
if hasattr(testunit, 'global_setup'):
return testunit
def pytest_runtest_setup(item):
testunit = get_testunit(item)
if testunit is not None:
testunit.global_setup()
def pytest_runtest_teardown(item):
testunit = get_testunit(item)
if testunit is not None:
testunit.global_teardown()

View File

@@ -1,28 +0,0 @@
# -*- coding: utf-8 -*-
# Created By: Virgil Dupras
# Created On: 2010-07-11
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
# This unit is required to make tests work with py.test. When running
import py
def get_testunit(item):
if hasattr(item, 'obj'):
testunit = py.builtin._getimself(item.obj)
if hasattr(testunit, 'global_setup'):
return testunit
def pytest_runtest_setup(item):
testunit = get_testunit(item)
if testunit is not None:
testunit.global_setup()
def pytest_runtest_teardown(item):
testunit = get_testunit(item)
if testunit is not None:
testunit.global_teardown()

View File

@@ -1,3 +1,14 @@
- date: 2010-12-30
version: 5.10.4
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 reading malformed aiff files. (#123)
- date: 2010-11-21
version: 5.10.3
description: |
* Fixed crash when reading malformed mp4 files. (#117 #118)
- date: 2010-10-06
version: 5.10.2
description: |

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
version: 1.11.2
description: |

View File

@@ -1,3 +1,9 @@
- date: 2011-01-01
version: 2.12.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)
- date: 2010-10-05
version: 2.12.2
description: |

View File

@@ -86,7 +86,7 @@ def package_debian(edition):
os.makedirs(destpath)
os.makedirs(srcpath)
shutil.copy('run.py', op.join(srcpath, 'run.py'))
packages = ['hscommon', 'hsgui', 'core', ed('core_{0}'), 'qtlib', 'qt', 'hsutil', 'send2trash']
packages = ['hscommon', 'core', ed('core_{0}'), 'qtlib', 'qt', 'hsutil', 'send2trash', 'jobprogress']
if edition == 'me':
packages.append('hsaudiotag')
copy_packages(packages, srcpath)

9
qt/ABOUT_LICENSE Normal file
View File

@@ -0,0 +1,9 @@
PyQt is used in this UI package, and PyQt is GPL software. I used PyQt before going releasing my
source as BSD, so I have commercial license. When I released this software as BSD, I assumed that,
BSD being incompatible with GPL, anyone wanting to redistribute this code would need a commercial
license from PyQt. Therefore, I had a warning here telling people they needed a commercial license
to modify and redistribute the qt code.
But no! There are good news. I saw that PyQt has special permissions in its "GPL_EXCEPTION.TXT"
file, thus making everything nice and shiny. The license of this software package is compatible with
PyQt's GPL license. No problem here.

View File

@@ -1,11 +0,0 @@
WARNING ABOUT THE HS LICENSE AND PyQt
Although Qt is now LGPL licensed, PyQt still is dual licensed. Until Nokia buys Riverbank and
releases PyQt as LGPL, users of this part of the code (The PyQt-based GUI code) have to use the
GPL version of PyQt, unless they possess a commercial license to it.
There is no problem to this AS LONG AS YOU DON'T REDISTRIBUTE HS LICENSED CODE. The GPL license, from the point of view of the user, is very permissive. You can do WHATEVER you want with the GPLed version of PyQt, as long as you don't redistribute any of the code, or code dependent on it. When you do, the code you distribute has to be GPL compliant. The HS license is NOT, I repeat, NOT compliant with the GPL.
So, what does it all mean? You have no restriction on the usage of the PyQt-dependent-HS-licensed code, but unless you possess a commercial PyQt license, Hardcoded Software (or anyone) cannot accept any contribution from you for this part of the code.
Note that this only affects the PyQt dependent code, and not any other part of HS licensed code (if it has "import PyQt4" in it, it's PyQt dependent code). For the rest of the code, the only restrictions that apply are the ones from the HS license.

View File

@@ -15,12 +15,12 @@ import os.path as op
from PyQt4.QtCore import QTimer, QObject, QCoreApplication, QUrl, SIGNAL, pyqtSignal
from PyQt4.QtGui import QDesktopServices, QFileDialog, QDialog, QMessageBox
from hscommon import job
from jobprogress import job
from jobprogress.qt import Progress
from core.app import DupeGuru as DupeGuruBase, JOB_SCAN, JOB_LOAD, JOB_MOVE, JOB_COPY, JOB_DELETE
from qtlib.about_box import AboutBox
from qtlib.progress import Progress
from qtlib.reg import Registration
from . import platform

View File

@@ -17,7 +17,7 @@ class DupeGuru(DupeGuruBase):
EDITION = 'me'
LOGO_NAME = 'logo_me'
NAME = 'dupeGuru Music Edition'
VERSION = '5.10.2'
VERSION = '5.10.4'
DELTA_COLUMNS = frozenset([2, 3, 4, 5, 7])
def __init__(self):
@@ -25,7 +25,7 @@ class DupeGuru(DupeGuruBase):
def _setup(self):
self.scanner = scanner.ScannerME()
self.directories.fileclasses = [fs.Mp3File, fs.Mp4File, fs.WmaFile, fs.OggFile, fs.FlacFile, fs.AiffFile]
self.directories.fileclasses = [fs.MusicFile]
DupeGuruBase._setup(self)
def _update_options(self):

View File

@@ -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):

View File

@@ -27,7 +27,7 @@ class DupeGuru(DupeGuruBase):
EDITION = 'se'
LOGO_NAME = 'logo_se'
NAME = 'dupeGuru'
VERSION = '2.12.2'
VERSION = '2.12.3'
DELTA_COLUMNS = frozenset([2, 4])
def __init__(self):

View File

@@ -12,6 +12,7 @@ sip.setapi('QVariant', 1)
from PyQt4.QtCore import QCoreApplication
from PyQt4.QtGui import QApplication, QIcon, QPixmap
from qtlib.error_report_dialog import install_excepthook
from qt.base import dg_rc
from qt.{{edition}}.app import DupeGuru
@@ -25,4 +26,5 @@ if __name__ == "__main__":
QCoreApplication.setApplicationName(DupeGuru.NAME)
QCoreApplication.setApplicationVersion(DupeGuru.VERSION)
dgapp = DupeGuru()
install_excepthook()
sys.exit(app.exec_())