From 96b9326b0f17235975b79bc772e267ce0d94909b Mon Sep 17 00:00:00 2001 From: Stephan Erb Date: Sun, 22 Nov 2009 22:14:05 +0100 Subject: [PATCH] Move function closer to where it is used. This makes it easier to reason about its usage. --- src/common/pep.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/pep.py b/src/common/pep.py index a991c35c7..3437d4a46 100644 --- a/src/common/pep.py +++ b/src/common/pep.py @@ -204,12 +204,6 @@ from common import gajim import gtkgui_helpers -def translate_mood(mood): - if mood in MOODS: - return MOODS[mood] - else: - return mood - class AbstractPEP(object): @@ -293,13 +287,19 @@ class UserMoodPEP(AbstractPEP): def asMarkupText(self): assert not self._retracted untranslated_mood = self._pep_specific_data['mood'] - mood = translate_mood(untranslated_mood) + mood = _translate_mood(untranslated_mood) markuptext = '%s' % gobject.markup_escape_text(mood) if 'text' in self._pep_specific_data: text = self._pep_specific_data['text'] markuptext += ' (%s)' % gobject.markup_escape_text(text) return markuptext + def _translate_mood(mood): + if mood in MOODS: + return MOODS[mood] + else: + return mood + class UserTunePEP(AbstractPEP): '''XEP-0118: User Tune'''