From bda1eb956029e705911095f32654f384ae9e8469 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 16 Dec 2010 20:28:26 -0600 Subject: [PATCH] add uppercase text transform --- modules/TextTransform.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/TextTransform.py b/modules/TextTransform.py index 92fe2f3..76b5120 100644 --- a/modules/TextTransform.py +++ b/modules/TextTransform.py @@ -39,6 +39,8 @@ class TextTransform(Module): return self.reply(connection, replypath, reply[0]) elif self.base64(what, reply): return self.reply(connection, replypath, reply[0]) + elif self.upper(what, reply): + return self.reply(connection, replypath, reply[0]) def rot13(self, what, reply): """ @@ -63,5 +65,15 @@ class TextTransform(Module): reply[0] = base64.decodestring(' '.join(whats[1:])).replace('\n','') return True + def upper(self, what, reply): + """ + Convert a string to uppercase. + """ + + whats = what.split(' ') + if whats[0] == 'upper' and len(whats) >= 2: + reply[0] = ' '.join(whats[1:]).upper() + return True + # vi:tabstop=4:expandtab:autoindent # kate: indent-mode python;indent-width 4;replace-tabs on;