From 00d8918433dda770ac62c7bb7ce9f3afda207035 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 22 May 2012 11:25:12 -0400 Subject: [PATCH 1/2] New option: prepend_filename. --- Tail/config.py | 3 +++ Tail/plugin.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Tail/config.py b/Tail/config.py index cc6e86f..1933582 100644 --- a/Tail/config.py +++ b/Tail/config.py @@ -53,6 +53,9 @@ class Targets(registry.SpaceSeparatedListOfStrings): conf.registerGlobalValue(Tail, 'targets', Targets([], """Determines what targets will be messaged with lines from the files being tailed.""")) +conf.registerGlobalValue(Tail, 'prepend_filename', + registry.Boolean(True, """Determines whether the bot will prepend the filename + to the tail lines announced to the channel.""")) conf.registerGlobalValue(Tail, 'bold', registry.Boolean(False, """Determines whether the bot will bold the filename in tail lines announced to the channel.""")) diff --git a/Tail/plugin.py b/Tail/plugin.py index 2905d82..4414cc4 100644 --- a/Tail/plugin.py +++ b/Tail/plugin.py @@ -91,7 +91,10 @@ def _send(self, irc, filename, text): if self.registryValue('bold'): filename = ircutils.bold(filename) notice = self.registryValue('notice') - payload = '%s: %s' % (filename, text) + if self.registryValue('prepend_filename'): + payload = '%s: %s' % (filename, text) + else: + payload = text for target in self.registryValue('targets'): irc.reply(payload, to=target, notice=notice, private=True) From 13f91a4cb5af9f079b2d38d2e27b8ba0ae216d57 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 22 May 2012 11:26:16 -0400 Subject: [PATCH 2/2] 'targets' is not implemented; say so explicitly --- Tail/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tail/plugin.py b/Tail/plugin.py index 4414cc4..72d4a57 100644 --- a/Tail/plugin.py +++ b/Tail/plugin.py @@ -142,8 +142,10 @@ def target(self, irc, msg, args, optlist, targets): irc.reply(format('%L', L)) else: irc.reply('I\'m not currently targeting anywhere.') - elif remove: - pass #XXX + else: + # XXX + irc.reply('Not implemented; use config plugins.Tail.targets instead') + target = wrap(target, [getopts({'remove': ''}), any('something')])