Skip to content
This repository was archived by the owner on Jun 18, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Tail/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""))
Expand Down
11 changes: 8 additions & 3 deletions Tail/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -139,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')])


Expand Down