[Kimchi-devel] [PATCH] [Wok 1/3] Add option to get Wok message text without code

Lucio Correia luciojhc at linux.vnet.ibm.com
Fri May 13 18:05:07 UTC 2016


Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
---
 src/wok/message.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/wok/message.py b/src/wok/message.py
index a3794d0..a7162c7 100644
--- a/src/wok/message.py
+++ b/src/wok/message.py
@@ -78,7 +78,11 @@ class WokMessage(object):
 
         return translation.gettext(text)
 
-    def get_text(self):
+    def get_text(self, prepend_code=True):
         msg = self._get_translation()
         msg = unicode(msg, 'utf-8') % self.args
-        return "%s: %s" % (self.code, msg)
+
+        if prepend_code:
+            return "%s: %s" % (self.code, msg)
+
+        return msg
-- 
1.9.1




More information about the Kimchi-devel mailing list