1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-10 05:34:36 +00:00

Fixed stupid bug with _do_delete() ME/PE overrides not having the right arguments.

This commit is contained in:
Virgil Dupras 2012-06-04 10:08:51 -04:00
parent ead3b1e651
commit 05478591a4
2 changed files with 8 additions and 8 deletions

View File

@ -146,12 +146,12 @@ class DupeGuruME(DupeGuruBase):
self.directories = Directories(fileclasses=self.directories.fileclasses) self.directories = Directories(fileclasses=self.directories.fileclasses)
self.dead_tracks = [] self.dead_tracks = []
def _do_delete(self, j, replace_with_hardlinks): def _do_delete(self, j, replace_with_hardlinks, direct_deletion):
# XXX If I read correctly, Python 3.3 will allow us to go fetch inner function easily, so # XXX If I read correctly, Python 3.3 will allow us to go fetch inner function easily, so
# we'll be able to replace "op" below with DupeGuruBase._do_delete.op. # we'll be able to replace "op" below with DupeGuruBase._do_delete.op.
def op(dupe): def op(dupe):
j.add_progress() j.add_progress()
return self._do_delete_dupe(dupe, replace_with_hardlinks) return self._do_delete_dupe(dupe, replace_with_hardlinks, direct_deletion)
marked = [dupe for dupe in self.results.dupes if self.results.is_marked(dupe)] marked = [dupe for dupe in self.results.dupes if self.results.is_marked(dupe)]
j.start_job(self.results.mark_count, tr("Sending dupes to the Trash")) j.start_job(self.results.mark_count, tr("Sending dupes to the Trash"))
@ -164,10 +164,10 @@ class DupeGuruME(DupeGuruBase):
pass pass
self.results.perform_on_marked(op, True) self.results.perform_on_marked(op, True)
def _do_delete_dupe(self, dupe, replace_with_hardlinks): def _do_delete_dupe(self, dupe, replace_with_hardlinks, direct_deletion):
if isinstance(dupe, ITunesSong): if isinstance(dupe, ITunesSong):
dupe.remove_from_library() dupe.remove_from_library()
DupeGuruBase._do_delete_dupe(self, dupe, replace_with_hardlinks) DupeGuruBase._do_delete_dupe(self, dupe, replace_with_hardlinks, direct_deletion)
def _create_file(self, path): def _create_file(self, path):
if (self.directories.itunes_libpath is not None) and (path in self.directories.itunes_libpath[:-1]): if (self.directories.itunes_libpath is not None) and (path in self.directories.itunes_libpath[:-1]):

View File

@ -135,10 +135,10 @@ class DupeGuruPE(DupeGuruBase):
DupeGuruBase.__init__(self, view, appdata) DupeGuruBase.__init__(self, view, appdata)
self.directories = Directories() self.directories = Directories()
def _do_delete(self, j, replace_with_hardlinks): def _do_delete(self, j, replace_with_hardlinks, direct_deletion):
def op(dupe): def op(dupe):
j.add_progress() j.add_progress()
return self._do_delete_dupe(dupe, replace_with_hardlinks) return self._do_delete_dupe(dupe, replace_with_hardlinks, direct_deletion)
marked = [dupe for dupe in self.results.dupes if self.results.is_marked(dupe)] marked = [dupe for dupe in self.results.dupes if self.results.is_marked(dupe)]
j.start_job(self.results.mark_count, tr("Sending dupes to the Trash")) j.start_job(self.results.mark_count, tr("Sending dupes to the Trash"))
@ -152,7 +152,7 @@ class DupeGuruPE(DupeGuruBase):
pass pass
self.results.perform_on_marked(op, True) self.results.perform_on_marked(op, True)
def _do_delete_dupe(self, dupe, replace_with_hardlinks): def _do_delete_dupe(self, dupe, replace_with_hardlinks, direct_deletion):
if isinstance(dupe, IPhoto): if isinstance(dupe, IPhoto):
try: try:
a = app('iPhoto') a = app('iPhoto')
@ -168,7 +168,7 @@ class DupeGuruPE(DupeGuruBase):
except (CommandError, RuntimeError) as e: except (CommandError, RuntimeError) as e:
raise EnvironmentError(str(e)) raise EnvironmentError(str(e))
else: else:
DupeGuruBase._do_delete_dupe(self, dupe, replace_with_hardlinks) DupeGuruBase._do_delete_dupe(self, dupe, replace_with_hardlinks, direct_deletion)
def _create_file(self, path): def _create_file(self, path):
if (self.directories.iphoto_libpath is not None) and (path in self.directories.iphoto_libpath[:-1]): if (self.directories.iphoto_libpath is not None) and (path in self.directories.iphoto_libpath[:-1]):