String: Trim trailing \n from encode's response.

Certain encode functions, like base64, add a trailing \n which simply clutters
the response for Supybot.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2009-04-06 11:29:11 -04:00
parent 6a0b667817
commit 804fbe8209

View File

@ -66,7 +66,7 @@ class String(callbacks.Plugin):
<http://docs.python.org/library/codecs.html#standard-encodings>. <http://docs.python.org/library/codecs.html#standard-encodings>.
""" """
try: try:
irc.reply(text.encode(encoding)) irc.reply(text.encode(encoding).rstrip('\n'))
except LookupError: except LookupError:
irc.errorInvalid('encoding', encoding) irc.errorInvalid('encoding', encoding)
encode = wrap(encode, ['something', 'text']) encode = wrap(encode, ['something', 'text'])