[kupfer: 31/38] google_translate: Define repr_key for query source



commit b04bd74df0cf21ee7023f039e539b89a5e3ddffc
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat Jan 16 06:09:29 2010 +0100

    google_translate: Define repr_key for query source

 kupfer/plugin/google_translate.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/google_translate.py b/kupfer/plugin/google_translate.py
index 96cc76e..e1db37b 100644
--- a/kupfer/plugin/google_translate.py
+++ b/kupfer/plugin/google_translate.py
@@ -187,6 +187,9 @@ class _TranslateQuerySource(Source):
 		self._text = text
 		self._lang = lang
 
+	def repr_key(self):
+		return (hash(self._text), self._lang)
+
 	def get_items(self):
 		for translation, desc in _translate(self._text, self._lang):
 			yield TranslationLeaf(translation.replace('\\n ', '\n'), desc)



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