From 34b8e53c3851784f83d682b14d72269410604ef0 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 17 Jun 2013 11:03:50 +0000 Subject: [PATCH] travis.yml: Fix tests runner for Python 2. --- .travis.yml | 2 +- plugins/Karma/plugin.py | 2 +- plugins/Misc/plugin.py | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d49d6220..ef09dd497 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,4 @@ install: script: - echo $TRAVIS_PYTHON_VERSION - python setup.py install - - supybot-test test --plugins-dir=./build/lib/supybot/plugins/ --no-network --disable-multiprocessing + - supybot-test test --plugins-dir=./build/lib*/supybot/plugins/ --no-network --disable-multiprocessing diff --git a/plugins/Karma/plugin.py b/plugins/Karma/plugin.py index 10862e978..2da7575dc 100644 --- a/plugins/Karma/plugin.py +++ b/plugins/Karma/plugin.py @@ -262,7 +262,7 @@ class Karma(callbacks.Plugin): def invalidCommand(self, irc, msg, tokens): channel = msg.args[0] - if not irc.isChannel(channel): + if not irc.isChannel(channel) or not tokens: return if tokens[-1][-2:] in ('++', '--'): thing = ' '.join(tokens) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 99186ff25..d161b0103 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -88,6 +88,7 @@ class Misc(callbacks.Plugin): def invalidCommand(self, irc, msg, tokens): assert not msg.repliedTo, 'repliedTo msg in Misc.invalidCommand.' assert self is irc.callbacks[-1], 'Misc isn\'t last callback.' + assert msg.command in ('PRIVMSG', 'NOTICE') self.log.debug('Misc.invalidCommand called (tokens %s)', tokens) # First, we check for invalidCommand floods. This is rightfully done # here since this will be the last invalidCommand called, and thus it @@ -125,7 +126,9 @@ class Misc(callbacks.Plugin): banmasker = conf.supybot.protocols.irc.banmask.makeBanmask self.invalidCommands.enqueue(msg) if self.invalidCommands.len(msg) > maximum and \ - not ircdb.checkCapability(msg.prefix, 'owner'): + not ircdb.checkCapability(msg.prefix, 'owner') and \ + msg.prefix != irc.prefix and \ + ircutils.isUserHostmask(msg.prefix): penalty = conf.supybot.abuse.flood.command.invalid.punishment() banmask = banmasker(msg.prefix, channel=None) self.log.info('Ignoring %s for %s seconds due to an apparent '