karma: just some whitespace code quality stuff
This commit is contained in:
parent
4bf922eef0
commit
6572a54cd2
@ -14,10 +14,12 @@ log = logging.getLogger('karma.ircplugin')
|
||||
|
||||
|
||||
class Karma(Plugin):
|
||||
|
||||
"""Track karma and report on it."""
|
||||
|
||||
def start(self):
|
||||
"""Set up the handlers."""
|
||||
|
||||
self.connection.add_global_handler('pubmsg', self.handle_chatter, -20)
|
||||
self.connection.add_global_handler('privmsg', self.handle_chatter, -20)
|
||||
|
||||
@ -36,6 +38,7 @@ class Karma(Plugin):
|
||||
|
||||
def stop(self):
|
||||
"""Tear down handlers."""
|
||||
|
||||
self.connection.remove_global_handler('pubmsg', self.handle_chatter)
|
||||
self.connection.remove_global_handler('privmsg', self.handle_chatter)
|
||||
|
||||
@ -48,6 +51,7 @@ class Karma(Plugin):
|
||||
@staticmethod
|
||||
def handle_chatter(connection, event):
|
||||
"""Watch karma from IRC chatter."""
|
||||
|
||||
what = event.arguments[0].lower()
|
||||
karma_pattern = r'(?:\((.+?)\)|(\S+))(\+\+|--|\+-|-\+)(\s+|$)'
|
||||
|
||||
@ -83,6 +87,7 @@ class Karma(Plugin):
|
||||
|
||||
def handle_rank(self, connection, event, match):
|
||||
"""Report on the rank of a karma item."""
|
||||
|
||||
where = event.target
|
||||
if where in settings.KARMA_IGNORE_COMMAND_TARGETS:
|
||||
log.debug("ignoring command in {0:s}".format(where))
|
||||
@ -99,6 +104,7 @@ class Karma(Plugin):
|
||||
|
||||
def handle_report(self, connection, event, match):
|
||||
"""Provide some karma reports."""
|
||||
|
||||
where = event.target
|
||||
if where in settings.KARMA_IGNORE_COMMAND_TARGETS:
|
||||
log.debug("ignoring command in {0:s}".format(where))
|
||||
@ -134,6 +140,7 @@ class Karma(Plugin):
|
||||
|
||||
def handle_stats(self, connection, event, match):
|
||||
"""Provide stats on a karma user."""
|
||||
|
||||
where = event.target
|
||||
if where in settings.KARMA_IGNORE_COMMAND_TARGETS:
|
||||
log.debug("ignoring command in {0:s}".format(where))
|
||||
|
Loading…
Reference in New Issue
Block a user