[kupfer] plugin.{selection,nautilusselection}: Bug fix repr_key



commit eb5aed07d329096c4ca86618f602fd5fbe5aae70
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Oct 27 15:59:51 2009 +0100

    plugin.{selection,nautilusselection}: Bug fix repr_key
    
    Both selection plugins define rank_key, but it should be repr_key.
    With this fix, the selection objects are always seen as the same by
    the learn algorithms, despite representing different selections at
    different times.
    
    This way the objects will increase their rank with more use.

 kupfer/plugin/nautilusselection.py |    4 ++--
 kupfer/plugin/selection.py         |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/kupfer/plugin/nautilusselection.py b/kupfer/plugin/nautilusselection.py
index 2db2484..7f4521b 100644
--- a/kupfer/plugin/nautilusselection.py
+++ b/kupfer/plugin/nautilusselection.py
@@ -20,9 +20,9 @@ class SelectedFile (FileLeaf):
 		basename = gobject.filename_display_basename(filepath)
 		FileLeaf.__init__(self, filepath, _('Selected File "%s"') % basename)
 
-	def rank_key(self):
+	def repr_key(self):
 		# return a constant rank key despite the changing name
-		return _("Selected File")
+		return "Selected File"
 
 class InvisibleSourceLeaf (SourceLeaf):
 	"""Hack to hide this source"""
diff --git a/kupfer/plugin/selection.py b/kupfer/plugin/selection.py
index 3f23919..548ceec 100644
--- a/kupfer/plugin/selection.py
+++ b/kupfer/plugin/selection.py
@@ -21,9 +21,9 @@ class SelectedText (TextLeaf):
 			summary = summary[:maxlen] + u".."
 		TextLeaf.__init__(self, text, _('Selected Text "%s"') % summary)
 
-	def rank_key(self):
+	def repr_key(self):
 		# return a constant rank key despite the changing name
-		return _("Selected Text")
+		return "Selected Text"
 
 class InvisibleSourceLeaf (SourceLeaf):
 	"""Hack to hide this source"""



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]