1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

Added tox configuration

... and fixed pep8 warnings. There's a lot of them that are still
ignored, but that's because it's too much of a step to take at once.
This commit is contained in:
Virgil Dupras
2014-10-13 15:08:59 -04:00
parent 24643a9b5d
commit 2166a0996c
46 changed files with 794 additions and 612 deletions

View File

@@ -12,4 +12,5 @@ either Cocoa's ``NSTableView`` or Qt's ``QTableView``. It tells them which cell
blue, which is supposed to be orange, does the sorting logic, holds selection, etc..
.. _cross-toolkit: http://www.hardcoded.net/articles/cross-toolkit-software
"""
"""

View File

@@ -1,31 +1,30 @@
# Created By: Virgil Dupras
# Created On: 2010-02-06
# Copyright 2014 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
#
# 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
from hscommon.notify import Listener
from hscommon.gui.base import NoopGUI
class DupeGuruGUIObject(Listener):
def __init__(self, app):
Listener.__init__(self, app)
self.app = app
def directories_changed(self):
pass
def dupes_selected(self):
pass
def marking_changed(self):
pass
def results_changed(self):
pass
def results_changed_but_keep_selection(self):
pass

View File

@@ -1,9 +1,9 @@
# Created By: Virgil Dupras
# Created On: 2011-09-06
# Copyright 2014 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
#
# 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
from hscommon.gui.base import GUIObject
@@ -13,7 +13,7 @@ class CriterionCategoryList(GUISelectableList):
def __init__(self, dialog):
self.dialog = dialog
GUISelectableList.__init__(self, [c.NAME for c in dialog.categories])
def _update_selection(self):
self.dialog.select_category(self.dialog.categories[self.selected_index])
GUISelectableList._update_selection(self)
@@ -22,10 +22,10 @@ class PrioritizationList(GUISelectableList):
def __init__(self, dialog):
self.dialog = dialog
GUISelectableList.__init__(self)
def _refresh_contents(self):
self[:] = [crit.display for crit in self.dialog.prioritizations]
def move_indexes(self, indexes, dest_index):
indexes.sort()
prilist = self.dialog.prioritizations
@@ -34,7 +34,7 @@ class PrioritizationList(GUISelectableList):
del prilist[i]
prilist[dest_index:dest_index] = selected
self._refresh_contents()
def remove_selected(self):
prilist = self.dialog.prioritizations
for i in sorted(self.selected_indexes, reverse=True):
@@ -51,15 +51,15 @@ class PrioritizeDialog(GUIObject):
self.criteria_list = GUISelectableList()
self.prioritizations = []
self.prioritization_list = PrioritizationList(self)
#--- Override
def _view_updated(self):
self.category_list.select(0)
#--- Private
def _sort_key(self, dupe):
return tuple(crit.sort_key(dupe) for crit in self.prioritizations)
#--- Public
def select_category(self, category):
self.criteria = category.criteria_list()
@@ -71,10 +71,11 @@ class PrioritizeDialog(GUIObject):
return
crit = self.criteria[self.criteria_list.selected_index]
self.prioritizations.append(crit)
del crit
self.prioritization_list[:] = [crit.display for crit in self.prioritizations]
def remove_selected(self):
self.prioritization_list.remove_selected()
def perform_reprioritization(self):
self.app.reprioritize_groups(self._sort_key)