Badwords: add plugin docstring, and fix/standardize some method docstrings.

This commit is contained in:
Daniel Folkinshteyn 2010-09-07 20:27:51 -04:00
parent 3c00d82579
commit 8d80fb9e88
2 changed files with 7 additions and 4 deletions

View File

@ -41,6 +41,9 @@ import supybot.ircutils as ircutils
import supybot.callbacks as callbacks import supybot.callbacks as callbacks
class BadWords(callbacks.Privmsg): class BadWords(callbacks.Privmsg):
"""Maintains a list of words that the bot is not allowed to say.
Can also be used to kick people that say these words, if the bot
has op."""
def __init__(self, irc): def __init__(self, irc):
self.__parent = super(BadWords, self) self.__parent = super(BadWords, self)
self.__parent.__init__(irc) self.__parent.__init__(irc)
@ -66,7 +69,7 @@ class BadWords(callbacks.Privmsg):
def inFilter(self, irc, msg): def inFilter(self, irc, msg):
self.filtering = True self.filtering = True
# We need to check for bad words here rather than in doPrivmsg because # We need to check for bad words here rather than in doPrivmsg because
# messages don't get to doPrivmsg is the user is ignored. # messages don't get to doPrivmsg if the user is ignored.
if msg.command == 'PRIVMSG': if msg.command == 'PRIVMSG':
self.updateRegexp() self.updateRegexp()
s = ircutils.stripFormatting(msg.args[1]) s = ircutils.stripFormatting(msg.args[1])
@ -120,7 +123,7 @@ class BadWords(callbacks.Privmsg):
def add(self, irc, msg, args, words): def add(self, irc, msg, args, words):
"""<word> [<word> ...] """<word> [<word> ...]
Adds all <word>s to the list of words the bot isn't to say. Adds all <word>s to the list of words being censored.
""" """
set = self.words() set = self.words()
set.update(words) set.update(words)
@ -131,7 +134,7 @@ class BadWords(callbacks.Privmsg):
def remove(self, irc, msg, args, words): def remove(self, irc, msg, args, words):
"""<word> [<word> ...] """<word> [<word> ...]
Removes a <word>s from the list of words the bot isn't to say. Removes <word>s from the list of words being censored.
""" """
set = self.words() set = self.words()
for word in words: for word in words:

View File

@ -1,3 +1,3 @@
"""stick the various versioning attributes in here, so we only have to change """stick the various versioning attributes in here, so we only have to change
them once.""" them once."""
version = '0.83.4.1+gribble (2010-09-04T01:25:57-0400)' version = '0.83.4.1+gribble (2010-09-07T20:27:51-0400)'