From b039c1e229be678e05f93cba1050d2550c6d138a Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 29 Jul 2008 07:20:12 +0000 Subject: [PATCH] don't require python2.5 --- src/chat_control.py | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 0a4d9b08f..1ed775e05 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -1231,13 +1231,15 @@ class ChatControl(ChatControlBase): mood = gobject.markup_escape_text(mood) text = gobject.markup_escape_text(text) - self._mood_image.set_tooltip_markup( - '%s%s%s' % (mood, - '\n' if text is not '' else '', text)) + markup = '%s' % mood + if text != '': + text += '\n' + text + self._mood_image.set_tooltip_markup(markup) else: - self._mood_tooltip.set_tip( - self._mood_image, '%s%s%s' % (mood, - '\n' if text is not '' else '', text)) + markup = mood + if text != '': + text += '\n' + text + self._mood_tooltip.set_tip(self._mood_image, markup) self._mood_image.show() else: self._mood_image.hide() @@ -1281,18 +1283,21 @@ class ChatControl(ChatControlBase): subactivity) text = gobject.markup_escape_text(text) - self._activity_image.set_tooltip_markup( - '%s%s%s%s%s' % (activity, - ': ' if subactivity is not '' else '', - subactivity, - '\n' if text is not '' else '', text)) + markup = '' + activity + if subactivity != '': + markup += ': ' + subactivity + markup += '' + if text != '': + markup += '\n' + text + self._activity_image.set_tooltip_markup(markup) else: + markup = activity + if subactivity != '': + markup += ': ' + subactivity + if text != '': + markup += '\n' + text self._activity_tooltip.set_tip( - self._activity_image, '%s%s%s%s%s' % ( - activity, - ': ' if subactivity is not '' else '', - subactivity, - '\n' if text is not '' else '', text)) + self._activity_image, markup) self._activity_image.show() else: