diff options
| author | 2019-07-15 14:27:04 +0100 | |
|---|---|---|
| committer | 2019-07-15 14:27:04 +0100 | |
| commit | 5cae13edba366d66526bb242631e8d17007e2eab (patch) | |
| tree | 23d1d823c8ee33be88221e093fa732d9567881cc /modules | |
| parent | don't silently truncate at newline in IRCLine.ParsedLine.truncate() (diff) | |
| signature | ||
replace \n\n with \n in command outputs
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/commands/outs.py | 8 |
1 files changed, 7 insertions, 1 deletions
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 |
