add uppercase text transform

This commit is contained in:
Brian S. Stephan 2010-12-16 20:28:26 -06:00
parent 699f550ba3
commit bda1eb9560
1 changed files with 12 additions and 0 deletions

View File

@ -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;