[kupfer] objects: Fix TextLeaf description



commit ab3329d3a1e197c84479da55237689355578fc53
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Wed Aug 26 20:04:06 2009 +0200

    objects: Fix TextLeaf description
    
    Here we do not reuse the TextLeaf name, since it can be set by others
    (Like Selected Text), and we don't want to repeat that in the
    description.

 kupfer/objects.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/objects.py b/kupfer/objects.py
index 16bc424..2dccb6f 100644
--- a/kupfer/objects.py
+++ b/kupfer/objects.py
@@ -1119,8 +1119,8 @@ class TextLeaf (Leaf):
 		return ()
 
 	def get_description(self):
-		lines = self.object.splitlines()
-		desc = unicode(self)
+		lines = [l for l in self.object.splitlines() if l.strip()]
+		desc = lines[0] if lines else self.object
 		numlines = len(lines) or 1
 
 		# TRANS: This is description for a TextLeaf, a free-text search



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