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

[#85 state:fixed] Fixed crash when sorting by Words Used after a Contents scan.

This commit is contained in:
Virgil Dupras 2010-02-05 17:47:17 +01:00
parent 25e12f1775
commit 7464e0f799
3 changed files with 9 additions and 9 deletions

View File

@ -85,9 +85,9 @@ def GetDupeSortKey(dupe, get_group, key, delta):
return m.percentage return m.percentage
if key == 18: if key == 18:
return 0 return 0
r = cmp_value(getattr(dupe, COLUMNS[key]['attr'])) r = cmp_value(getattr(dupe, COLUMNS[key]['attr'], ''))
if delta and (key in (2, 3, 4, 7, 8)): if delta and (key in (2, 3, 4, 7, 8)):
r -= cmp_value(getattr(get_group().ref, COLUMNS[key]['attr'])) r -= cmp_value(getattr(get_group().ref, COLUMNS[key]['attr'], ''))
return r return r
def GetGroupSortKey(group, key): def GetGroupSortKey(group, key):
@ -95,4 +95,4 @@ def GetGroupSortKey(group, key):
return group.percentage return group.percentage
if key == 18: if key == 18:
return len(group) return len(group)
return cmp_value(getattr(group.ref, COLUMNS[key]['attr'])) return cmp_value(getattr(group.ref, COLUMNS[key]['attr'], ''))

View File

@ -63,9 +63,9 @@ def GetDupeSortKey(dupe, get_group, key, delta):
return m.percentage return m.percentage
if key == 8: if key == 8:
return 0 return 0
r = cmp_value(getattr(dupe, COLUMNS[key]['attr'])) r = cmp_value(getattr(dupe, COLUMNS[key]['attr'], ''))
if delta and (key in (2, 5, 6)): if delta and (key in (2, 5, 6)):
r -= cmp_value(getattr(get_group().ref, COLUMNS[key]['attr'])) r -= cmp_value(getattr(get_group().ref, COLUMNS[key]['attr'], ''))
return r return r
def GetGroupSortKey(group, key): def GetGroupSortKey(group, key):
@ -73,5 +73,5 @@ def GetGroupSortKey(group, key):
return group.percentage return group.percentage
if key == 8: if key == 8:
return len(group) return len(group)
return cmp_value(getattr(group.ref, COLUMNS[key]['attr'])) return cmp_value(getattr(group.ref, COLUMNS[key]['attr'], ''))

View File

@ -58,9 +58,9 @@ def GetDupeSortKey(dupe, get_group, key, delta):
return m.percentage return m.percentage
if key == 8: if key == 8:
return 0 return 0
r = cmp_value(getattr(dupe, COLUMNS[key]['attr'])) r = cmp_value(getattr(dupe, COLUMNS[key]['attr'], ''))
if delta and (key in (2, 4, 5)): if delta and (key in (2, 4, 5)):
r -= cmp_value(getattr(get_group().ref, COLUMNS[key]['attr'])) r -= cmp_value(getattr(get_group().ref, COLUMNS[key]['attr'], ''))
return r return r
def GetGroupSortKey(group, key): def GetGroupSortKey(group, key):
@ -68,4 +68,4 @@ def GetGroupSortKey(group, key):
return group.percentage return group.percentage
if key == 8: if key == 8:
return len(group) return len(group)
return cmp_value(getattr(group.ref, COLUMNS[key]['attr'])) return cmp_value(getattr(group.ref, COLUMNS[key]['attr'], ''))