add simple plugin disable config option

This commit is contained in:
Ryan Hitchman 2010-04-06 02:36:43 -06:00
parent 2a11825779
commit 62cc0490d1
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,5 @@
import re
from util import hook
@ -18,4 +20,9 @@ def sieve_suite(bot, input, func, kind, args):
if input.chan.lower() in denied_channels:
return None
fn = re.match(r'^plugins.(.+).py$', func._filename)
disabled = bot.config.get('disabled_plugins', {})
if fn and fn.group(1).lower() in disabled:
return None
return input

View File

@ -70,7 +70,7 @@ def get_nicks_by_tag(db, chan, subject):
" and chan=?"
" order by lower(nick)", (subject, chan)).fetchall()
nicks = [munge(x[0], 3) for x in nicks]
nicks = [munge(x[0], 1) for x in nicks]
if not nicks:
return 'tag not found'
return 'nicks tagged "%s": ' % subject + ', '.join(nicks)