From b5b841033f94feb9d7074137bf8a085c3a6ab4ad Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 6 Mar 2019 08:08:20 +0000 Subject: [PATCH] Do format parsing (color, bold, etc) in format_activity.py --- modules/format_activity.py | 4 ++-- modules/print_activity.py | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/format_activity.py b/modules/format_activity.py index 2e973296..c7edbec0 100644 --- a/modules/format_activity.py +++ b/modules/format_activity.py @@ -3,8 +3,8 @@ from src import EventManager, ModuleManager, utils class Module(ModuleManager.BaseModule): def _event(self, type, server, line, context): - self.events.on("formatted").on(type).call(server=server, line=line, - context=context) + self.events.on("formatted").on(type).call(server=server, + context=context, line=utils.irc.parse_format(line)) def _mode_symbols(self, user, channel, server): modes = channel.get_user_status(user) diff --git a/modules/print_activity.py b/modules/print_activity.py index 48b539f5..3b0e7825 100644 --- a/modules/print_activity.py +++ b/modules/print_activity.py @@ -2,10 +2,6 @@ import datetime from src import EventManager, ModuleManager, utils class Module(ModuleManager.BaseModule): - def _print_line(self, target, context, line): - formatted_line = utils.irc.parse_format(line) - self.bot.log.info("%s%s | %s", [target, context or "", formatted_line]) - @utils.hook("formatted.message.channel") @utils.hook("formatted.notice.channel") @utils.hook("formatted.join") @@ -21,4 +17,5 @@ class Module(ModuleManager.BaseModule): @utils.hook("formatted.rename") @utils.hook("formatted.motd") def formatted(self, event): - self._print_line(str(event["server"]), event["context"], event["line"]) + self.bot.log.info("%s%s | %s", [ + str(event["server"]), event["context"] or "", event["line"]])