From a995c0997747e9e313d4758dbff6072fc3c3c936 Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Fri, 28 Dec 2007 22:04:17 +0000 Subject: [PATCH] Escape pep in tooltips without breaking tooltips, third try :p --- src/tooltips.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/tooltips.py b/src/tooltips.py index caca009b2..78214f352 100644 --- a/src/tooltips.py +++ b/src/tooltips.py @@ -500,42 +500,49 @@ class RosterTooltip(NotificationAreaTooltip): # we append show below if contact.mood.has_key('mood'): - mood_string = _('Mood:') + ' %s' % contact.mood['mood'].strip() + mood = contact.mood['mood'].strip() + mood = gobject.markup_escape_text(mood) + mood_string = _('Mood:') + ' %s' % mood if contact.mood.has_key('text') and contact.mood['text'] != '': - mood_string += ' (%s)' % contact.mood['text'].strip() - mood_string = gobject.markup_escape_text(mood_string) + mood_text = contact.mood['text'].strip() + mood_text = gobject.markup_escape_text(mood_text) + mood_string += ' (%s)' % mood_text properties.append((mood_string, None)) if contact.activity.has_key('activity'): activity = contact.activity['activity'].strip() + activity = gobject.markup_escape_text(activity) activity_string = _('Activity:') + ' %s' % activity if contact.activity.has_key('subactivity'): activity_sub = contact.activity['subactivity'].strip() + activity_sub = gobject.markup_escape_text(activity_sub) activity_string += ' (%s)' % activity_sub else: activity_string += '' if contact.activity.has_key('text'): activity_text = contact.activity['text'].strip() + activity_text = gobject.markup_escape_text(activity_text) activity_string += ' (%s)' % activity_text - activity_string = gobject.markup_escape_text(activity_string) properties.append((activity_string, None)) if contact.tune.has_key('artist') or contact.tune.has_key('title'): if contact.tune.has_key('artist'): artist = contact.tune['artist'].strip() + artist = gobject.markup_escape_text(artist) else: artist = _('Unknown Artist') if contact.tune.has_key('title'): title = contact.tune['title'].strip() + title = gobject.markup_escape_text(title) else: title = _('Unknown Title') if contact.tune.has_key('source'): source = contact.tune['source'].strip() + source = gobject.markup_escape_text(source) else: source = _('Unknown Source') tune_string = _('Tune:') + ' ' + _('"%(title)s" by %(artist)s\nfrom %(source)s' %\ {'title': title, 'artist': artist, 'source': source}) - tune_string = gobject.markup_escape_text(tune_string) properties.append((tune_string, None)) if contact.status: