1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

[#138] Added ME-specific prioritizations and adjusted ME cocoa proj to the pri dialog.

This commit is contained in:
Virgil Dupras
2011-09-16 12:24:56 -04:00
parent 5a26f1c2ae
commit 664803c2ca
6 changed files with 95 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ from hscommon.util import format_time, format_size
from hscommon.trans import tr as trbase
from core.data import (format_timestamp, format_words, format_perc, format_dupe_count, cmp_value,
Column)
from . import prioritize
tr = lambda s: trbase(s, 'columns')
@@ -99,3 +100,6 @@ def GetGroupSortKey(group, key):
if key == DUPECOUNT_COL:
return len(group)
return cmp_value(getattr(group.ref, COLUMNS[key].attr, ''))
def prioritization_categories():
return prioritize.all_categories()

33
core_me/prioritize.py Normal file
View File

@@ -0,0 +1,33 @@
# Created On: 2011/09/16
# Copyright 2011 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
from hscommon.trans import tr
from core.prioritize import (KindCategory, FolderCategory, FilenameCategory, NumericalCategory,
SizeCategory, MtimeCategory)
class DurationCategory(NumericalCategory):
NAME = tr("Duration")
def extract_value(self, dupe):
return dupe.duration
class BitrateCategory(NumericalCategory):
NAME = tr("Bitrate")
def extract_value(self, dupe):
return dupe.bitrate
class SamplerateCategory(NumericalCategory):
NAME = tr("Samplerate")
def extract_value(self, dupe):
return dupe.samplerate
def all_categories():
return [KindCategory, FolderCategory, FilenameCategory, SizeCategory, DurationCategory,
BitrateCategory, SamplerateCategory, MtimeCategory]