mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user