From 358533b33521e4bcf4d7944f19924d1bb4ff2a54 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 13 Sep 2003 13:39:41 +0000 Subject: [PATCH] Removed deepthought command now that we have a supyfact for it. --- plugins/Http.py | 24 ------------------------ test/test_Http.py | 3 --- 2 files changed, 27 deletions(-) diff --git a/plugins/Http.py b/plugins/Http.py index 8748c5aa1..c729472b5 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -79,30 +79,6 @@ class FreshmeatException(Exception): class Http(callbacks.Privmsg): threaded = True - def __init__(self): - callbacks.Privmsg.__init__(self) - self.deepthoughtq = structures.queue() - self.deepthoughts = sets.Set() - - def deepthought(self, irc, msg, args): - """takes no arguments - - Returns a Deep Thought by Jack Handey. - """ - url = 'http://www.tremorseven.com/aim/deepaim.php?job=view' - now = time.time() - thought = None - while self.deepthoughtq and now - self.deepthoughtq[0][0] > 86400: - s = self.deepthoughtq.dequeue()[1] - self.deepthoughts.remove(s) - while thought is None or thought in self.deepthoughts: - fd = urllib2.urlopen(url) - s = fd.read() - thought = s.split('
')[2] - thought = utils.normalizeWhitespace(thought) - self.deepthoughtq.enqueue((now, thought)) - self.deepthoughts.add(thought) - irc.reply(msg, thought) _titleRe = re.compile(r'(.*)', re.I | re.S) def title(self, irc, msg, args): diff --git a/test/test_Http.py b/test/test_Http.py index 3aa5beb7b..46b2e4e9f 100644 --- a/test/test_Http.py +++ b/test/test_Http.py @@ -33,9 +33,6 @@ from test import * class HttpTest(PluginTestCase, PluginDocumentation): plugins = ('Http',) - def testDeepthought(self): - self.assertNotError('deepthought') - def testStockquote(self): self.assertNotError('stockquote MSFT')