From b4e12a10bc8f784212d077de37bf5faa1f9b316b Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 8 Nov 2003 00:10:09 +0000 Subject: [PATCH] Fixed some bugs. --- src/plugins.py | 5 ++++- src/privmsgs.py | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins.py b/src/plugins.py index b0d4bec51..b2a0b0f32 100644 --- a/src/plugins.py +++ b/src/plugins.py @@ -219,7 +219,10 @@ class ConfigurableDictionary(object): def get(self, name, channel=None): name = callbacks.canonicalName(name) if channel is not None: - return self.channels[channel][name] + try: + return self.channels[channel][name] + except KeyError: + return self.defaults[name] else: return self.defaults[name] diff --git a/src/privmsgs.py b/src/privmsgs.py index e723236ab..e2da40e33 100644 --- a/src/privmsgs.py +++ b/src/privmsgs.py @@ -35,12 +35,14 @@ Includes various accessories for callbacks.Privmsg based callbacks. import fix +import time import types import conf import ircdb import ircutils import callbacks +import structures def getChannel(msg, args): """Returns the channel the msg came over or the channel given in args. @@ -157,11 +159,12 @@ def urlSnarfer(f): cutoff = now - conf.snarfThrottle q = getattr(self, '_snarfedUrls', None) if q is None: - q = structures.fastqueue() + q = structures.smallqueue() while q and q[0][2] < cutoff: q.dequeue() url = match.group(0) - if any(lambda t: t[0] == url and t[1] == msg.args[0], q): + if any(lambda t: t[0] == url and t[1] == msg.args[0], q) and \ + not world.testing: debug.msg('Refusing to snarf %s.') else: q.enqueue((url, msg.args[0], now))