From 5cae13edba366d66526bb242631e8d17007e2eab Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 15 Jul 2019 14:27:04 +0100 Subject: [PATCH] replace \n\n with \n in command outputs --- modules/commands/outs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/commands/outs.py b/modules/commands/outs.py index df7ce0c4..2677d1bf 100644 --- a/modules/commands/outs.py +++ b/modules/commands/outs.py @@ -24,6 +24,8 @@ class Out(object): self._text += text self.written = True return self + def writeline(self, line): + self._text += "%s\n" % line def send(self, method): if self.has_text(): @@ -31,7 +33,11 @@ class Out(object): if not self._hide_prefix: prefix = utils.consts.RESET + "[%s] " % self._prefix - full_text = "%s%s" % (prefix, self._text) + text = self._text[:].replace("\r", "") + while "\n\n" in text: + text = text.replace("\n\n", "\n") + + full_text = "%s%s" % (prefix, text) line_factory = None if method == "PRIVMSG": line_factory = utils.irc.protocol.privmsg